mirror of
https://github.com/spf13/viper
synced 2025-05-06 12:17:18 +00:00
replace SetEnvReplacer by SetEnvKeyReplacer
This commit is contained in:
parent
b53595fb56
commit
fa88aecca5
1 changed files with 2 additions and 2 deletions
|
@ -184,7 +184,7 @@ with ENV:
|
||||||
* `AutomaticEnv()`
|
* `AutomaticEnv()`
|
||||||
* `BindEnv(string...) : error`
|
* `BindEnv(string...) : error`
|
||||||
* `SetEnvPrefix(string)`
|
* `SetEnvPrefix(string)`
|
||||||
* `SetEnvReplacer(string...) *strings.Replacer`
|
* `SetEnvKeyReplacer(string...) *strings.Replacer`
|
||||||
|
|
||||||
_When working with ENV variables, it’s important to recognize that Viper
|
_When working with ENV variables, it’s important to recognize that Viper
|
||||||
treats ENV variables as case sensitive._
|
treats ENV variables as case sensitive._
|
||||||
|
@ -211,7 +211,7 @@ time a `viper.Get` request is made. It will apply the following rules. It will
|
||||||
check for a environment variable with a name matching the key uppercased and
|
check for a environment variable with a name matching the key uppercased and
|
||||||
prefixed with the `EnvPrefix` if set.
|
prefixed with the `EnvPrefix` if set.
|
||||||
|
|
||||||
`SetEnvReplacer` allows you to use a `strings.Replacer` object to rewrite Env
|
`SetEnvKeyReplacer` allows you to use a `strings.Replacer` object to rewrite Env
|
||||||
keys to an extent. This is useful if you want to use `-` or something in your
|
keys to an extent. This is useful if you want to use `-` or something in your
|
||||||
`Get()` calls, but want your environmental variables to use `_` delimiters. An
|
`Get()` calls, but want your environmental variables to use `_` delimiters. An
|
||||||
example of using it can be found in `viper_test.go`.
|
example of using it can be found in `viper_test.go`.
|
||||||
|
|
Loading…
Add table
Reference in a new issue