|
|
@ -316,6 +316,8 @@ func coalesceTables(dst, src map[string]interface{}) map[string]interface{} {
|
|
|
|
dst[key] = val
|
|
|
|
dst[key] = val
|
|
|
|
} else if istable(innerdst) {
|
|
|
|
} else if istable(innerdst) {
|
|
|
|
coalesceTables(innerdst.(map[string]interface{}), val.(map[string]interface{}))
|
|
|
|
coalesceTables(innerdst.(map[string]interface{}), val.(map[string]interface{}))
|
|
|
|
|
|
|
|
} else if isnull(innerdst) {
|
|
|
|
|
|
|
|
delete(dst, key)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log.Printf("warning: cannot overwrite table with non table for %s (%v)", key, val)
|
|
|
|
log.Printf("warning: cannot overwrite table with non table for %s (%v)", key, val)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -388,6 +390,11 @@ func istable(v interface{}) bool {
|
|
|
|
return ok
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isnull is a special-purpose function to see if the present thing matches the definition of a YAML null.
|
|
|
|
|
|
|
|
func isnull(v interface{}) bool {
|
|
|
|
|
|
|
|
return v == "null" || v == "Null" || v == "NULL" || v == "~"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// PathValue takes a path that traverses a YAML structure and returns the value at the end of that path.
|
|
|
|
// PathValue takes a path that traverses a YAML structure and returns the value at the end of that path.
|
|
|
|
// The path starts at the root of the YAML structure and is comprised of YAML keys separated by periods.
|
|
|
|
// The path starts at the root of the YAML structure and is comprised of YAML keys separated by periods.
|
|
|
|
// Given the following YAML data the value at path "chapter.one.title" is "Loomings".
|
|
|
|
// Given the following YAML data the value at path "chapter.one.title" is "Loomings".
|
|
|
|