Skip to content

Commit

Permalink
Check Anonymous field
Browse files Browse the repository at this point in the history
  • Loading branch information
yyoshiki41 committed Sep 23, 2016
1 parent 0b4aa9f commit daefced
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func cacheStruct(t reflect.Type) structCache {
sf := t.Field(i)
// Only unexported fields have a PkgPath; we want to only cache
// exported fields.
if sf.PkgPath != "" {
if sf.PkgPath != "" && !sf.Anonymous {
continue
}
name := extractName(sf)
Expand Down

0 comments on commit daefced

Please sign in to comment.