1
0
mirror of https://github.com/json-iterator/go.git synced 2024-11-27 08:30:57 +02:00

#88 #85 support embedded struct with json tags

This commit is contained in:
Tao Wen 2017-06-30 13:26:50 +08:00
parent cfaa11f837
commit 401a56bc20

View File

@ -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 {
if field.Anonymous && field.Tag.Get("json") == "" {
if field.Type.Kind() == reflect.Struct {
structDescriptor, err := describeStruct(cfg, field.Type)
if err != nil {