Skip to content

Commit aa7e203

Browse files
committed
cleaner example
Signed-off-by: Eugene <[email protected]>
1 parent 5d421be commit aa7e203

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

prometheus/promsafe/safe_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func ExampleNewCounterVecT_multiple_labels_manual() {
5151

5252
c := promsafe.NewCounterVecT(prometheus.CounterOpts{
5353
Name: "items_counted_detailed",
54-
}, &MyCounterLabels{})
54+
}, new(MyCounterLabels))
5555

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

9191
c.With(&TicketReservationAttemptsLabels{
9292
EventType: "reservation", Source: "source1",
@@ -121,7 +121,7 @@ func ExampleNewCounterVecT_promauto_global_migrated() {
121121
Status string
122122
Source string
123123
}
124-
c := promsafe.NewCounterVecT(counterOpts, &TicketReservationAttemptsLabels{})
124+
c := promsafe.NewCounterVecT(counterOpts, new(TicketReservationAttemptsLabels))
125125

126126
c.With(&TicketReservationAttemptsLabels{
127127
Status: "active", Source: "source1",

0 commit comments

Comments
 (0)