mirror of
https://github.com/spf13/viper
synced 2025-05-10 22:27: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 {
|
func (v *Viper) isPathShadowedInFlatMap(path []string, mi interface{}) string {
|
||||||
// unify input map
|
// unify input map
|
||||||
var m map[string]interface{}
|
var m map[string]interface{}
|
||||||
switch mi.(type) {
|
switch miv := mi.(type) {
|
||||||
case map[string]string, map[string]FlagValue:
|
case map[string]string:
|
||||||
m = cast.ToStringMap(mi)
|
m = castMapStringToMapInterface(miv)
|
||||||
|
case map[string]FlagValue:
|
||||||
|
m = castMapFlagToMapInterface(miv)
|
||||||
default:
|
default:
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue