diff --git a/tool/json2go/parser.go b/tool/json2go/parser.go index 2aef5b4..c845602 100644 --- a/tool/json2go/parser.go +++ b/tool/json2go/parser.go @@ -97,7 +97,9 @@ func (jg *JSON2GO) parseArray(key string, parseResult gjson.Result) { } // 对象,重新 if dataType == "object" { - dataType = "map[string]interface{}" + instance := NewJSON2GO("") + r, _ := instance.Parse(parseResult.Array()[0].String()) + dataType = strings.Replace(strings.Replace(r, "type", "", 1), "Automatic", "", 1) } // 所有数据类型都一致 if len(key) == 0 {