Skip to content

Commit

Permalink
metrics/internal/convert: use method value insetad of lambda (#767)
Browse files Browse the repository at this point in the history
Method value signature matches expected callback signature,
so there is no need in explicit lambda wrapping.
  • Loading branch information
Iskander (Alex) Sharipov authored and peterbourgon committed Oct 1, 2018
1 parent 14dac5d commit 81cf14a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions metrics/internal/convert/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand All @@ -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)
}
}
Expand Down

0 comments on commit 81cf14a

Please sign in to comment.