diff --git a/struct.go b/struct.go index 8af3c08..56094ba 100644 --- a/struct.go +++ b/struct.go @@ -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)