mirror of
https://github.com/spf13/viper
synced 2025-05-06 20:27:17 +00:00
Add Get(string) support for uint.
This commit is contained in:
parent
7e20eda4ff
commit
28d2298bcd
1 changed files with 6 additions and 0 deletions
6
viper.go
6
viper.go
|
@ -633,6 +633,12 @@ func (v *Viper) Get(key string) interface{} {
|
|||
return cast.ToString(val)
|
||||
case int64, int32, int16, int8, int:
|
||||
return cast.ToInt(val)
|
||||
case uint:
|
||||
return cast.ToUint(val)
|
||||
case uint32:
|
||||
return cast.ToUint32(val)
|
||||
case uint64:
|
||||
return cast.ToUint64(val)
|
||||
case float64, float32:
|
||||
return cast.ToFloat64(val)
|
||||
case time.Time:
|
||||
|
|
Loading…
Add table
Reference in a new issue