feat: add func GetEnvPrefix

This commit is contained in:
Baruch Odem 2023-06-13 11:04:31 +03:00 committed by Márk Sági-Kazár
parent 31af6d09c2
commit 731a91be43

View file

@ -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)