Skip to content

Commit

Permalink
fix: support embedded union interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Nov 30, 2023
1 parent 9d97a23 commit f8e85da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion struct.go
Expand Up @@ -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
Expand Down

0 comments on commit f8e85da

Please sign in to comment.