t.Run requires two arguments: name, and t *testing,T, so func should be used instead.

Shashwat Kansal 2022-10-21 17:08:57 +01:00
parent b58532d87d
commit 4e2054c8c7

@ -75,7 +75,7 @@ tests := map[string]struct {
for name, test := range tests {
t.Parallel()
test := test
t.Run(name, t.Run(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
if got, expected := reverse(test.input), test.result; got != expected {
t.Fatalf("reverse(%q) returned %q; expected %q", test.input, got, expected)