summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/viper/viper.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-06-11 23:07:42 +0200
committerGitHub <noreply@github.com>2022-06-11 23:07:42 +0200
commit8751fb4bb1eb7cd34ed63be9b3801b8aeac71a1d (patch)
tree601d2616b05b5b197bd2a3ae7cb245b1a0ea17e7 /vendor/github.com/spf13/viper/viper.go
parent3819062574ac7e4af6a562bf40a425469a7752fb (diff)
downloadmatterbridge-msglm-8751fb4bb1eb7cd34ed63be9b3801b8aeac71a1d.tar.gz
matterbridge-msglm-8751fb4bb1eb7cd34ed63be9b3801b8aeac71a1d.tar.bz2
matterbridge-msglm-8751fb4bb1eb7cd34ed63be9b3801b8aeac71a1d.zip
Update dependencies (#1841)
Diffstat (limited to 'vendor/github.com/spf13/viper/viper.go')
-rw-r--r--vendor/github.com/spf13/viper/viper.go29
1 files changed, 25 insertions, 4 deletions
diff --git a/vendor/github.com/spf13/viper/viper.go b/vendor/github.com/spf13/viper/viper.go
index 4a9dac9d..a3812e92 100644
--- a/vendor/github.com/spf13/viper/viper.go
+++ b/vendor/github.com/spf13/viper/viper.go
@@ -1197,6 +1197,17 @@ func (v *Viper) BindEnv(input ...string) error {
return nil
}
+// MustBindEnv wraps BindEnv in a panic.
+// If there is an error binding an environment variable, MustBindEnv will
+// panic.
+func MustBindEnv(input ...string) { v.MustBindEnv(input...) }
+
+func (v *Viper) MustBindEnv(input ...string) {
+ if err := v.BindEnv(input...); err != nil {
+ panic(fmt.Sprintf("error while binding environment variable: %v", err))
+ }
+}
+
// Given a key, find the value.
//
// Viper will check to see if an alias exists first.
@@ -1798,8 +1809,13 @@ func mergeMaps(
tsv, ok := sv.(map[interface{}]interface{})
if !ok {
v.logger.Error(
- "Could not cast sv to map[interface{}]interface{}; key=%s, st=%v, tt=%v, sv=%v, tv=%v",
- sk, svType, tvType, sv, tv)
+ "Could not cast sv to map[interface{}]interface{}",
+ "key", sk,
+ "st", svType,
+ "tt", tvType,
+ "sv", sv,
+ "tv", tv,
+ )
continue
}
@@ -1811,8 +1827,13 @@ func mergeMaps(
tsv, ok := sv.(map[string]interface{})
if !ok {
v.logger.Error(
- "Could not cast sv to map[string]interface{}; key=%s, st=%v, tt=%v, sv=%v, tv=%v",
- sk, svType, tvType, sv, tv)
+ "Could not cast sv to map[string]interface{}",
+ "key", sk,
+ "st", svType,
+ "tt", tvType,
+ "sv", sv,
+ "tv", tv,
+ )
continue
}
mergeMaps(tsv, ttv, nil)