cleaner example

Signed-off-by: Eugene <eugene@amberpixels.io>
This commit is contained in:
Eugene 2024-08-31 11:06:19 +03:00
parent 5d421be191
commit aa7e203147
No known key found for this signature in database
GPG Key ID: 51AC89611A689305
1 changed files with 3 additions and 3 deletions

View File

@ -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",