From 4d83580f69f8c8bb346bf88a6d5d6442afff107e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Wed, 10 Nov 2021 18:47:44 +0800 Subject: [PATCH] =?UTF-8?q?list=20=E6=AF=8F=E4=B8=80=E9=A1=B9=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=8C=89=E7=85=A7=E5=AF=B9=E8=B1=A1=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/json2go/parser.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 {