Skip to content

Commit dcf308f

Browse files
committed
fix(internal/testkit): do not require Map, Slice, and Chan to be pointers
1 parent 50094a9 commit dcf308f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/testkit/util.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@ func Ptr[T any](v T) *T { return &v }
3030
// in unit tests to ensure the test cases are valid.
3131
func RequirePointer(t *testing.T, v any, name string) {
3232
t.Helper()
33-
require.Equalf(t, reflect.Pointer, reflect.TypeOf(v).Kind(), "%q must be a pointer", name)
33+
switch reflect.TypeOf(v).Kind() {
34+
case reflect.Map, reflect.Slice, reflect.Chan, reflect.Pointer:
35+
return
36+
default:
37+
require.FailNow(t, "%q must be a pointer", name)
38+
}
3439
}

0 commit comments

Comments
 (0)