From daefcedbda0ee6003dc721cae0e37542b3acd582 Mon Sep 17 00:00:00 2001 From: yyoshiki41 Date: Fri, 23 Sep 2016 12:46:45 +0900 Subject: [PATCH] Check Anonymous field --- struct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)