|
|
@ -312,36 +312,34 @@ func coalesceListsFullKey(printf printFn, dst, src []interface{}, prefix string,
|
|
|
|
// Because dest has higher precedence than src, dest values override src
|
|
|
|
// Because dest has higher precedence than src, dest values override src
|
|
|
|
// values.
|
|
|
|
// values.
|
|
|
|
for key, val := range src {
|
|
|
|
for key, val := range src {
|
|
|
|
|
|
|
|
fullkey := concatPrefix(prefix, fmt.Sprintf("%v", key))
|
|
|
|
|
|
|
|
|
|
|
|
if key == len(dst) {
|
|
|
|
if key == len(dst) {
|
|
|
|
dst = append(dst, val)
|
|
|
|
dst = append(dst, val)
|
|
|
|
} else if dst[key] == nil {
|
|
|
|
} else if dst[key] == nil {
|
|
|
|
dst[key] = val
|
|
|
|
dst[key] = val
|
|
|
|
} else if istable(val) {
|
|
|
|
} else if istable(val) {
|
|
|
|
if !istable(dst[key]) {
|
|
|
|
if !istable(dst[key]) {
|
|
|
|
fullkey := concatPrefix(prefix, fmt.Sprintf("%v", key))
|
|
|
|
|
|
|
|
printf("warning: cannot overwrite table with non table for %s (%v)", fullkey, val)
|
|
|
|
printf("warning: cannot overwrite table with non table for %s (%v)", fullkey, val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst[key] = coalesceTablesFullKey(
|
|
|
|
dst[key] = coalesceTablesFullKey(
|
|
|
|
printf,
|
|
|
|
printf,
|
|
|
|
dst[key].(map[string]interface{}),
|
|
|
|
dst[key].(map[string]interface{}),
|
|
|
|
val.(map[string]interface{}),
|
|
|
|
val.(map[string]interface{}),
|
|
|
|
prefix,
|
|
|
|
fullkey,
|
|
|
|
merge,
|
|
|
|
merge,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
} else if islist(val) {
|
|
|
|
} else if islist(val) {
|
|
|
|
if !islist(dst[key]) {
|
|
|
|
if !islist(dst[key]) {
|
|
|
|
fullkey := concatPrefix(prefix, fmt.Sprintf("%v", key))
|
|
|
|
|
|
|
|
printf("warning: cannot overwrite list with non list for %s (%v)", fullkey, val)
|
|
|
|
printf("warning: cannot overwrite list with non list for %s (%v)", fullkey, val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst[key] = coalesceListsFullKey(
|
|
|
|
dst[key] = coalesceListsFullKey(
|
|
|
|
printf,
|
|
|
|
printf,
|
|
|
|
dst[key].([]interface{}),
|
|
|
|
dst[key].([]interface{}),
|
|
|
|
val.([]interface{}),
|
|
|
|
val.([]interface{}),
|
|
|
|
prefix,
|
|
|
|
fullkey,
|
|
|
|
merge,
|
|
|
|
merge,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
|
|
|
|
dst[key] = val
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return dst
|
|
|
|
return dst
|
|
|
|