summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/viper
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/spf13/viper')
-rw-r--r--vendor/github.com/spf13/viper/.editorconfig2
-rw-r--r--vendor/github.com/spf13/viper/.golangci.yaml (renamed from vendor/github.com/spf13/viper/.golangci.yml)0
-rw-r--r--vendor/github.com/spf13/viper/internal/encoding/toml/codec.go4
-rw-r--r--vendor/github.com/spf13/viper/internal/encoding/toml/codec2.go4
-rw-r--r--vendor/github.com/spf13/viper/internal/encoding/yaml/yaml2.go4
-rw-r--r--vendor/github.com/spf13/viper/internal/encoding/yaml/yaml3.go4
-rw-r--r--vendor/github.com/spf13/viper/viper.go29
7 files changed, 34 insertions, 13 deletions
diff --git a/vendor/github.com/spf13/viper/.editorconfig b/vendor/github.com/spf13/viper/.editorconfig
index 63afcbcd..6d0b6d35 100644
--- a/vendor/github.com/spf13/viper/.editorconfig
+++ b/vendor/github.com/spf13/viper/.editorconfig
@@ -11,5 +11,5 @@ trim_trailing_whitespace = true
[*.go]
indent_style = tab
-[{Makefile, *.mk}]
+[{Makefile,*.mk}]
indent_style = tab
diff --git a/vendor/github.com/spf13/viper/.golangci.yml b/vendor/github.com/spf13/viper/.golangci.yaml
index 16e03965..16e03965 100644
--- a/vendor/github.com/spf13/viper/.golangci.yml
+++ b/vendor/github.com/spf13/viper/.golangci.yaml
diff --git a/vendor/github.com/spf13/viper/internal/encoding/toml/codec.go b/vendor/github.com/spf13/viper/internal/encoding/toml/codec.go
index ff1112ca..45fddc8b 100644
--- a/vendor/github.com/spf13/viper/internal/encoding/toml/codec.go
+++ b/vendor/github.com/spf13/viper/internal/encoding/toml/codec.go
@@ -1,5 +1,5 @@
-//go:build !viper_toml2
-// +build !viper_toml2
+//go:build viper_toml1
+// +build viper_toml1
package toml
diff --git a/vendor/github.com/spf13/viper/internal/encoding/toml/codec2.go b/vendor/github.com/spf13/viper/internal/encoding/toml/codec2.go
index 566b7062..112c6d37 100644
--- a/vendor/github.com/spf13/viper/internal/encoding/toml/codec2.go
+++ b/vendor/github.com/spf13/viper/internal/encoding/toml/codec2.go
@@ -1,5 +1,5 @@
-//go:build viper_toml2
-// +build viper_toml2
+//go:build !viper_toml1
+// +build !viper_toml1
package toml
diff --git a/vendor/github.com/spf13/viper/internal/encoding/yaml/yaml2.go b/vendor/github.com/spf13/viper/internal/encoding/yaml/yaml2.go
index ca29b84d..4c398c2f 100644
--- a/vendor/github.com/spf13/viper/internal/encoding/yaml/yaml2.go
+++ b/vendor/github.com/spf13/viper/internal/encoding/yaml/yaml2.go
@@ -1,5 +1,5 @@
-//go:build !viper_yaml3
-// +build !viper_yaml3
+//go:build viper_yaml2
+// +build viper_yaml2
package yaml
diff --git a/vendor/github.com/spf13/viper/internal/encoding/yaml/yaml3.go b/vendor/github.com/spf13/viper/internal/encoding/yaml/yaml3.go
index 96b8957f..3a4775ce 100644
--- a/vendor/github.com/spf13/viper/internal/encoding/yaml/yaml3.go
+++ b/vendor/github.com/spf13/viper/internal/encoding/yaml/yaml3.go
@@ -1,5 +1,5 @@
-//go:build viper_yaml3
-// +build viper_yaml3
+//go:build !viper_yaml2
+// +build !viper_yaml2
package yaml
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)