diff --git a/cmp/cmpopts/ignore.go b/cmp/cmpopts/ignore.go index afd36be..77936de 100644 --- a/cmp/cmpopts/ignore.go +++ b/cmp/cmpopts/ignore.go @@ -128,7 +128,7 @@ func newUnexportedFilter(typs ...interface{}) unexportedFilter { for _, typ := range typs { t := reflect.TypeOf(typ) if t == nil || t.Kind() != reflect.Struct { - panic(fmt.Sprintf("invalid struct type: %T", typ)) + panic(fmt.Sprintf("%T must be a struct", typ)) } ux.m[t] = true } diff --git a/cmp/cmpopts/util_test.go b/cmp/cmpopts/util_test.go index 37704c8..5892660 100644 --- a/cmp/cmpopts/util_test.go +++ b/cmp/cmpopts/util_test.go @@ -1304,13 +1304,13 @@ func TestPanic(t *testing.T) { label: "IgnoreUnexported", fnc: IgnoreUnexported, args: args(nil), - wantPanic: "invalid struct type", + wantPanic: " must be a struct", reason: "input must not be nil value", }, { label: "IgnoreUnexported", fnc: IgnoreUnexported, args: args(&Foo1{}), - wantPanic: "invalid struct type", + wantPanic: "*cmpopts.Foo1 must be a struct", reason: "input must be a struct type (not a pointer to a struct)", }, { label: "IgnoreUnexported",