Skip to content

Commit f8e85da

Browse files
committed
fix: support embedded union interfaces
1 parent 9d97a23 commit f8e85da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

struct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func collectFieldIndexes(s reflect.Type) (out [][]int, err error) {
124124
for i := 0; i < s.NumField(); i++ {
125125
f := s.Field(i)
126126
switch {
127-
case f.Anonymous: // nolint: gocritic
127+
case f.Anonymous && f.Type.Kind() == reflect.Struct: // Embedded struct.
128128
children, err := collectFieldIndexes(f.Type)
129129
if err != nil {
130130
return nil, err

0 commit comments

Comments
 (0)