Skip to content

Commit

Permalink
Merge pull request goji#5 from yyoshiki41/go1.6/reflect
Browse files Browse the repository at this point in the history
Exclude exported fields in embedded structs
  • Loading branch information
zenazn committed Sep 27, 2016
2 parents 0b4aa9f + daefced commit d7f49fd
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 d7f49fd

Please sign in to comment.