diff --git a/cmd/modern-go-application/config.go b/cmd/modern-go-application/config.go index f6d74473..0dce84c5 100644 --- a/cmd/modern-go-application/config.go +++ b/cmd/modern-go-application/config.go @@ -2,7 +2,6 @@ package main import ( "errors" - "fmt" "os" "strings" "time" @@ -128,10 +127,9 @@ func (c telemetryConfig) Validate() error { func configure(v *viper.Viper, p *pflag.FlagSet) { // Viper settings v.AddConfigPath(".") - v.AddConfigPath(fmt.Sprintf("$%s_CONFIG_DIR/", strings.ToUpper(envPrefix))) + v.AddConfigPath("$CONFIG_DIR/") // Environment variable settings - v.SetEnvPrefix(envPrefix) v.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) v.AllowEmptyEnv(true) v.AutomaticEnv() diff --git a/cmd/modern-go-application/vars.go b/cmd/modern-go-application/vars.go index 77781e64..c58ecc3a 100644 --- a/cmd/modern-go-application/vars.go +++ b/cmd/modern-go-application/vars.go @@ -9,7 +9,4 @@ const ( // friendlyAppName is the visible name of the application. friendlyAppName = "Modern Go Application" - - // envPrefix is prepended to environment variables when processing configuration. - envPrefix = "app" )