config: RawConfig merge should only set unknown keys non-nil if
non-empty
This commit is contained in:
parent
a89dcfd1b1
commit
fee0351c66
|
@ -191,6 +191,7 @@ func (r *RawConfig) Merge(other *RawConfig) *RawConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the unknown keys
|
// Build the unknown keys
|
||||||
|
if len(r.unknownKeys) > 0 || len(other.unknownKeys) > 0 {
|
||||||
unknownKeys := make(map[string]struct{})
|
unknownKeys := make(map[string]struct{})
|
||||||
for _, k := range r.unknownKeys {
|
for _, k := range r.unknownKeys {
|
||||||
unknownKeys[k] = struct{}{}
|
unknownKeys[k] = struct{}{}
|
||||||
|
@ -203,6 +204,7 @@ func (r *RawConfig) Merge(other *RawConfig) *RawConfig {
|
||||||
for k, _ := range unknownKeys {
|
for k, _ := range unknownKeys {
|
||||||
result.unknownKeys = append(result.unknownKeys, k)
|
result.unknownKeys = append(result.unknownKeys, k)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue