list object 解析成[]map[string]interface{}

This commit is contained in:
zhangdeman committed 2021-11-09 22:45:20 +08:00
1 parent 911ff18b5a
commit a29a211ee5
1 file changed
+4
+4
View File
@@ -95,6 +95,10 @@ func (jg *JSON2GO) parseArray(key string, parseResult gjson.Result) {
return return
} }
} }
// 对象,重新
if dataType == "object" {
dataType = "map[string]interface{}"
}
// 所有数据类型都一致 // 所有数据类型都一致
if len(key) == 0 { if len(key) == 0 {
jg.append("[]" + dataType) jg.append("[]" + dataType)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.