mirror of
https://github.com/spf13/viper
synced 2024-12-22 19:47:01 +00:00
feat: add func GetEnvPrefix
This commit is contained in:
parent
31af6d09c2
commit
731a91be43
1 changed files with 6 additions and 0 deletions
6
viper.go
6
viper.go
|
@ -523,6 +523,12 @@ func (v *Viper) SetEnvPrefix(in string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetEnvPrefix() string { return v.GetEnvPrefix() }
|
||||||
|
|
||||||
|
func (v *Viper) GetEnvPrefix() string {
|
||||||
|
return v.envPrefix
|
||||||
|
}
|
||||||
|
|
||||||
func (v *Viper) mergeWithEnvPrefix(in string) string {
|
func (v *Viper) mergeWithEnvPrefix(in string) string {
|
||||||
if v.envPrefix != "" {
|
if v.envPrefix != "" {
|
||||||
return strings.ToUpper(v.envPrefix + "_" + in)
|
return strings.ToUpper(v.envPrefix + "_" + in)
|
||||||
|
|
Loading…
Reference in a new issue