From ea8fa7cc63fd24a1b3ef4abae0586ee478c52ec2 Mon Sep 17 00:00:00 2001 From: Tao Wen Date: Sat, 1 Jul 2017 00:00:38 +0800 Subject: [PATCH] #91 fix embedded and , --- feature_reflect_extension.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature_reflect_extension.go b/feature_reflect_extension.go index 67f449b..f17e654 100644 --- a/feature_reflect_extension.go +++ b/feature_reflect_extension.go @@ -200,7 +200,7 @@ func describeStruct(cfg *frozenConfig, typ reflect.Type) (*StructDescriptor, err bindings := []*Binding{} for i := 0; i < typ.NumField(); i++ { field := typ.Field(i) - if field.Anonymous && field.Tag.Get("json") == "" { + if field.Anonymous && (field.Tag.Get("json") == "" || strings.Split(field.Tag.Get("json"), ",")[0] == "") { if field.Type.Kind() == reflect.Struct { structDescriptor, err := describeStruct(cfg, field.Type) if err != nil {