fix:add keypath to shadow set when map empty

This commit is contained in:
ramkimpls 2024-01-18 17:30:27 -06:00
parent c44f929787
commit bcdfa9abcf
1 changed files with 4 additions and 0 deletions

View File

@ -2097,6 +2097,10 @@ func (v *Viper) flattenAndMergeMap(shadow map[string]bool, m map[string]any, pre
if shadow == nil {
shadow = make(map[string]bool)
}
if len(m) == 0 && prefix != ""{
shadow[strings.ToLower(prefix)]=true
return shadow
}
var m2 map[string]any
if prefix != "" {