mirror of
https://github.com/spf13/viper
synced 2025-01-01 08:16:37 +00:00
fix:add keypath to shadow set when map empty
This commit is contained in:
parent
c44f929787
commit
bcdfa9abcf
1 changed files with 4 additions and 0 deletions
4
viper.go
4
viper.go
|
@ -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 != "" {
|
||||
|
|
Loading…
Reference in a new issue