Explorar o código

Do not include index in when adding slice to tree path

Vigilans hai 1 ano
pai
achega
a55952ebe3
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      infra/conf/merge/rules.go

+ 2 - 2
infra/conf/merge/rules.go

@@ -31,9 +31,9 @@ func sortMergeSlices(target map[string]interface{}, path string) error {
 				return err
 			}
 			target[key] = s
-			for i, item := range s {
+			for _, item := range s {
 				if m, ok := item.(map[string]interface{}); ok {
-					sortMergeSlices(m, fmt.Sprintf("%s.%s.%d", path, key, i))
+					sortMergeSlices(m, fmt.Sprintf("%s.%s[]", path, key))
 				}
 			}
 		} else if field, ok := value.(map[string]interface{}); ok {