Pārlūkot izejas kodu

#91 fix embedded and ,

Tao Wen 8 gadi atpakaļ
vecāks
revīzija
ea8fa7cc63
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      feature_reflect_extension.go

+ 1 - 1
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 {