Skip to content

Commit

Permalink
chore(BUX-586): moves environment variable prefix to const string
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmkowalski committed Feb 20, 2024
1 parent 8ab1b83 commit e38c145
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import (
"github.com/spf13/viper"
)

const (
// EnvPrefix is the prefix for environment variables
EnvPrefix = "SPV"
)

// Added a mutex lock for a race-condition
var viperLock sync.Mutex

Expand Down Expand Up @@ -68,7 +73,7 @@ func setDefaults() error {
}

func envConfig() {
viper.SetEnvPrefix("SPV")
viper.SetEnvPrefix(EnvPrefix)
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.AutomaticEnv()
}
Expand Down

0 comments on commit e38c145

Please sign in to comment.