mirror of https://github.com/spf13/viper.git
fix:add keypath to shadow set when map empty
This commit is contained in:
parent
c44f929787
commit
bcdfa9abcf
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 {
|
if shadow == nil {
|
||||||
shadow = make(map[string]bool)
|
shadow = make(map[string]bool)
|
||||||
}
|
}
|
||||||
|
if len(m) == 0 && prefix != ""{
|
||||||
|
shadow[strings.ToLower(prefix)]=true
|
||||||
|
return shadow
|
||||||
|
}
|
||||||
|
|
||||||
var m2 map[string]any
|
var m2 map[string]any
|
||||||
if prefix != "" {
|
if prefix != "" {
|
||||||
|
|
Loading…
Reference in New Issue