From 234ef9af300c43a668ef4b9e35c961e88b5719d6 Mon Sep 17 00:00:00 2001 From: Iskander Sharipov Date: Mon, 1 Oct 2018 11:15:21 +0300 Subject: [PATCH] metrics/internal/convert: use method value insetad of lambda Method value signature matches expected callback signature, so there is no need in explicit lambda wrapping. --- metrics/internal/convert/convert_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/metrics/internal/convert/convert_test.go b/metrics/internal/convert/convert_test.go index df3ecf023..b8527904d 100644 --- a/metrics/internal/convert/convert_test.go +++ b/metrics/internal/convert/convert_test.go @@ -17,8 +17,7 @@ func TestCounterHistogramConversion(t *testing.T) { if want, have := name, low.Name; want != have { t.Errorf("Name: want %q, have %q", want, have) } - value := func() float64 { return low.Value() } - if err := teststat.TestCounter(top, value); err != nil { + if err := teststat.TestCounter(top, low.Value); err != nil { t.Fatal(err) } } @@ -33,8 +32,7 @@ func TestCounterGaugeConversion(t *testing.T) { if want, have := name, low.Name; want != have { t.Errorf("Name: want %q, have %q", want, have) } - value := func() float64 { return low.Value() } - if err := teststat.TestCounter(top, value); err != nil { + if err := teststat.TestCounter(top, low.Value); err != nil { t.Fatal(err) } }