diff --git a/httpbin/cmd/cmd.go b/httpbin/cmd/cmd.go index 88f49e4..d7d6dd2 100644 --- a/httpbin/cmd/cmd.go +++ b/httpbin/cmd/cmd.go @@ -204,7 +204,7 @@ func loadConfig(args []string, getEnvVal func(string) string, getEnviron func() } // helper to generate a new ConfigError to return - configErr := func(format string, a ...interface{}) error { + configErr := func(format string, a ...any) error { return ConfigError{ Err: fmt.Errorf(format, a...), Usage: usage, diff --git a/httpbin/cmd/cmd_test.go b/httpbin/cmd/cmd_test.go index 44d4a1f..b72ad5b 100644 --- a/httpbin/cmd/cmd_test.go +++ b/httpbin/cmd/cmd_test.go @@ -528,7 +528,6 @@ func TestLoadConfig(t *testing.T) { } for name, tc := range testCases { - tc := tc t.Run(name, func(t *testing.T) { t.Parallel() @@ -617,7 +616,6 @@ func TestMainImpl(t *testing.T) { } for name, tc := range testCases { - tc := tc t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/httpbin/digest/digest_test.go b/httpbin/digest/digest_test.go index c3ccb10..004c1e0 100644 --- a/httpbin/digest/digest_test.go +++ b/httpbin/digest/digest_test.go @@ -118,7 +118,6 @@ func TestHash(t *testing.T) { {digestAlgorithm(10), []byte("hello, world!\n"), "910c8bc73110b0cd1bc5d2bcae782511"}, } for _, test := range tests { - test := test t.Run(fmt.Sprintf("hash/%v", test.algorithm), func(t *testing.T) { t.Parallel() result := hash(test.data, test.algorithm) @@ -180,7 +179,6 @@ func TestParseDictHeader(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.input, func(t *testing.T) { t.Parallel() results := parseDictHeader(test.input) @@ -272,7 +270,6 @@ func TestParseAuthorizationHeader(t *testing.T) { } for i, test := range tests { - test := test t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { t.Parallel() got := parseAuthorizationHeader(test.input) diff --git a/httpbin/handlers.go b/httpbin/handlers.go index 36b9a59..ae9c585 100644 --- a/httpbin/handlers.go +++ b/httpbin/handlers.go @@ -188,7 +188,7 @@ func createSpecialCases(prefix string) map[int]*statusCase { ] } `) - statusHTTP300body := []byte(fmt.Sprintf(` + statusHTTP300body := fmt.Appendf(nil, `