mirror of
https://github.com/spf13/viper.git
synced 2026-10-19 16:15:33 +00:00
feat: add func GetEnvPrefix
This commit is contained in:
committed by
Márk Sági-Kazár
parent
31af6d09c2
commit
731a91be43
@@ -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 {
|
||||
if v.envPrefix != "" {
|
||||
return strings.ToUpper(v.envPrefix + "_" + in)
|
||||
|
||||
Reference in New Issue
Block a user