From db3fe19e6a6d63b224688bd92d7100fbcef3140a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sun, 30 Jan 2022 23:56:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=B0=E7=BB=84=E9=80=92?= =?UTF-8?q?=E5=BD=92=E6=8F=90=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- json_tool/gabs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/json_tool/gabs.go b/json_tool/gabs.go index cdaf074..4a6e316 100644 --- a/json_tool/gabs.go +++ b/json_tool/gabs.go @@ -173,7 +173,7 @@ func (df *DataFilter) formatRule() { } // 数组层级深度不同,重新对对齐数据 diffArr := sourcePathArr[0 : len(sourcePathArr)-len(mapPathArr)+1] - if newPath := df.dealDiffArr(diffArr, sourcePathArr[len(sourcePathArr)-len(mapPathArr)-1:], mapPathArr); len(newPath) > 0 { + if newPath := df.dealDiffArr(diffArr); len(newPath) > 0 { sourcePathArr[len(sourcePathArr)-len(mapPathArr)] = newPath item.SourceKey = strings.Join(sourcePathArr[len(sourcePathArr)-len(mapPathArr):], ".[].") } @@ -202,7 +202,7 @@ func (df *DataFilter) formatRule() { // Author : go_developer@163.com<白茶清欢> // // Date : 5:04 下午 2022/1/25 -func (df *DataFilter) dealDiffArr(diffArr []string, sourceAfterArr []string, mapArr []string) string { +func (df *DataFilter) dealDiffArr(diffArr []string) string { if len(diffArr) == 0 { return "" }