Skip to content

Commit

Permalink
feat: add func GetEnvPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
baruchiro authored and sagikazarmark committed Jun 29, 2023
1 parent 31af6d0 commit 731a91b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 731a91b

Please sign in to comment.