From 70f27e465a78c3848e4d8f0b6f20011f9f0db47d Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Thu, 15 Mar 2018 23:09:11 +0100 Subject: [PATCH] Handle maps in type inference from default values --- viper.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/viper.go b/viper.go index 46b1a85..982b516 100644 --- a/viper.go +++ b/viper.go @@ -871,6 +871,10 @@ func (v *Viper) Get(key string) interface{} { return cast.ToStringSlice(val) case []int: return cast.ToIntSlice(val) + case map[string]string: + return cast.ToStringMapString(val) + case map[string]interface{}: + return cast.ToStringMap(val) } }