From b4f55a56addbd73e7e9f1696a19f0b5441e26b9a Mon Sep 17 00:00:00 2001 From: Chase Adams Date: Wed, 26 Apr 2017 03:13:56 -0700 Subject: [PATCH] add method for GetStringMapBool --- viper.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/viper.go b/viper.go index 31b41a6..fe2efb5 100644 --- a/viper.go +++ b/viper.go @@ -53,7 +53,7 @@ func init() { type remoteConfigFactory interface { Get(rp RemoteProvider) (io.Reader, error) Watch(rp RemoteProvider) (io.Reader, error) - WatchChannel(rp RemoteProvider)(<-chan *RemoteResponse, chan bool) + WatchChannel(rp RemoteProvider) (<-chan *RemoteResponse, chan bool) } // RemoteConfig is optional, see the remote package @@ -703,6 +703,12 @@ func (v *Viper) GetStringMapString(key string) map[string]string { return cast.ToStringMapString(v.Get(key)) } +// GetStringMapBool returns the value associated with the key as a map of strings. +func GetStringMapBool(key string) map[string]bool { return v.GetStringMapBool(key) } +func (v *Viper) GetStringMapBool(key string) map[string]bool { + return cast.ToStringMapBool(v.Get(key)) +} + // GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings. func GetStringMapStringSlice(key string) map[string][]string { return v.GetStringMapStringSlice(key) } func (v *Viper) GetStringMapStringSlice(key string) map[string][]string {