mirror of
https://github.com/spf13/viper
synced 2025-05-07 20:57:18 +00:00
fix isPathShadowedInFlatMap type cast bug
This commit is contained in:
parent
097e0d888f
commit
31d0f6cf8a
1 changed files with 5 additions and 3 deletions
8
viper.go
8
viper.go
|
@ -827,9 +827,11 @@ func (v *Viper) isPathShadowedInDeepMap(path []string, m map[string]interface{})
|
|||
func (v *Viper) isPathShadowedInFlatMap(path []string, mi interface{}) string {
|
||||
// unify input map
|
||||
var m map[string]interface{}
|
||||
switch mi.(type) {
|
||||
case map[string]string, map[string]FlagValue:
|
||||
m = cast.ToStringMap(mi)
|
||||
switch miv := mi.(type) {
|
||||
case map[string]string:
|
||||
m = castMapStringToMapInterface(miv)
|
||||
case map[string]FlagValue:
|
||||
m = castMapFlagToMapInterface(miv)
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue