Replaces dot in env variable name with underscore so they can be used in bash.

This commit is contained in:
Yuce Tekol 2017-10-10 06:15:22 +03:00
parent 1819cf7845
commit 83bb0f97d4
No known key found for this signature in database
GPG key ID: CB59E46D2FB90573

View file

@ -91,7 +91,7 @@ func setAllConfig(v *viper.Viper, flags *pflag.FlagSet, envPrefix string) error
// add env to viper
v.SetEnvPrefix(envPrefix)
v.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
v.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_"))
v.AutomaticEnv()
c := v.GetString("config")