From 28d2298bcd531f70d298436e6e47c8d4c2851f34 Mon Sep 17 00:00:00 2001 From: Mitch Connors <mitchconnors@gmail.com> Date: Fri, 5 Apr 2019 11:42:15 -0700 Subject: [PATCH] Add Get(string) support for uint. --- viper.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/viper.go b/viper.go index a1b4d5f..13c2518 100644 --- a/viper.go +++ b/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: