list 每一项支持按照对象解析

This commit is contained in:
白茶清欢 2021-11-10 18:47:44 +08:00
parent a29a211ee5
commit 4d83580f69

View File

@ -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 {