diff --git a/struct.go b/struct.go index 6205244..ae67cc0 100644 --- a/struct.go +++ b/struct.go @@ -124,7 +124,7 @@ func collectFieldIndexes(s reflect.Type) (out [][]int, err error) { for i := 0; i < s.NumField(); i++ { f := s.Field(i) switch { - case f.Anonymous: // nolint: gocritic + case f.Anonymous && f.Type.Kind() == reflect.Struct: // Embedded struct. children, err := collectFieldIndexes(f.Type) if err != nil { return nil, err