1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-19 18:36:10 -04:00

Do not include index in when adding slice to tree path

This commit is contained in:
Vigilans 2024-05-24 22:52:11 +08:00 committed by Xiaokang Wang (Shelikhoo)
parent 7243392af2
commit a55952ebe3

View File

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