Skip to content

Commit

Permalink
cleaner example
Browse files Browse the repository at this point in the history
  • Loading branch information
amberpixels committed Aug 30, 2024
1 parent 5d421be commit 091995d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prometheus/promsafe/safe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func ExampleNewCounterVecT_multiple_labels_manual() {

c := promsafe.NewCounterVecT(prometheus.CounterOpts{
Name: "items_counted_detailed",
}, &MyCounterLabels{})
}, new(MyCounterLabels))

// Manually register the counter
if err := prometheus.Register(c.Unsafe()); err != nil {
Expand Down Expand Up @@ -86,7 +86,7 @@ func ExampleNewCounterVecT_promauto_migrated() {
EventType string
Source string
}
c := promsafe.WithAuto(myReg).NewCounterVecT(counterOpts, &TicketReservationAttemptsLabels{})
c := promsafe.WithAuto(myReg).NewCounterVecT(counterOpts, new(TicketReservationAttemptsLabels))

c.With(&TicketReservationAttemptsLabels{
EventType: "reservation", Source: "source1",
Expand Down Expand Up @@ -121,7 +121,7 @@ func ExampleNewCounterVecT_promauto_global_migrated() {
Status string
Source string
}
c := promsafe.NewCounterVecT(counterOpts, &TicketReservationAttemptsLabels{})
c := promsafe.NewCounterVecT(counterOpts, new(TicketReservationAttemptsLabels))

c.With(&TicketReservationAttemptsLabels{
Status: "active", Source: "source1",
Expand Down

0 comments on commit 091995d

Please sign in to comment.