From aa7e203147efa69269ccb7a94309e74bd6be3c01 Mon Sep 17 00:00:00 2001 From: Eugene Date: Sat, 31 Aug 2024 11:06:19 +0300 Subject: [PATCH] cleaner example Signed-off-by: Eugene --- prometheus/promsafe/safe_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prometheus/promsafe/safe_test.go b/prometheus/promsafe/safe_test.go index d0f65c2..02a68fc 100644 --- a/prometheus/promsafe/safe_test.go +++ b/prometheus/promsafe/safe_test.go @@ -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 { @@ -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", @@ -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",