From 10e59acdae64bf0927af23312caca7ffde401893 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 28 Mar 2021 18:50:25 +0200 Subject: [PATCH] fix: test string-int concatenation warnings --- internal/reqdata/parse_parameter_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/reqdata/parse_parameter_test.go b/internal/reqdata/parse_parameter_test.go index 65e7c4b..0fa4ffc 100644 --- a/internal/reqdata/parse_parameter_test.go +++ b/internal/reqdata/parse_parameter_test.go @@ -1,6 +1,7 @@ package reqdata import ( + "fmt" "math" "testing" ) @@ -24,7 +25,7 @@ func TestSimpleFloat(t *testing.T) { tcases := []float64{12.3456789, -12.3456789, 0.0000001, -0.0000001} for i, tcase := range tcases { - t.Run("case "+string(i), func(t *testing.T) { + t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { p := parseParameter(tcase) cast, canCast := p.(float64) @@ -45,7 +46,7 @@ func TestSimpleBool(t *testing.T) { tcases := []bool{true, false} for i, tcase := range tcases { - t.Run("case "+string(i), func(t *testing.T) { + t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { p := parseParameter(tcase) cast, canCast := p.(bool) @@ -136,7 +137,7 @@ func TestJsonPrimitiveBool(t *testing.T) { } for i, tcase := range tcases { - t.Run("case "+string(i), func(t *testing.T) { + t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { p := parseParameter(tcase.Raw) cast, canCast := p.(bool) @@ -173,7 +174,7 @@ func TestJsonPrimitiveFloat(t *testing.T) { } for i, tcase := range tcases { - t.Run("case "+string(i), func(t *testing.T) { + t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { p := parseParameter(tcase.Raw) cast, canCast := p.(float64)