mirror of
https://github.com/spf13/viper
synced 2024-11-16 18:07:02 +00:00
Handle maps in type inference from default values
This commit is contained in:
parent
5c0d079c4e
commit
70f27e465a
1 changed files with 4 additions and 0 deletions
4
viper.go
4
viper.go
|
@ -871,6 +871,10 @@ func (v *Viper) Get(key string) interface{} {
|
||||||
return cast.ToStringSlice(val)
|
return cast.ToStringSlice(val)
|
||||||
case []int:
|
case []int:
|
||||||
return cast.ToIntSlice(val)
|
return cast.ToIntSlice(val)
|
||||||
|
case map[string]string:
|
||||||
|
return cast.ToStringMapString(val)
|
||||||
|
case map[string]interface{}:
|
||||||
|
return cast.ToStringMap(val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue