From f8e85dae160cb04d967dc1079e9b8471c53c837d Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Fri, 1 Dec 2023 09:27:57 +1100 Subject: [PATCH] fix: support embedded union interfaces --- struct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/struct.go b/struct.go index 62052448..ae67cc09 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