diff options
author | Patrick Connolly <patrick.c.connolly@gmail.com> | 2018-11-03 21:42:27 +0800 |
---|---|---|
committer | Wim <wim@42.be> | 2018-11-03 14:42:27 +0100 |
commit | 7e62bc4819f23c57726225916f97c45ed04c60f9 (patch) | |
tree | 15c3a67167d90ad4b6dda038517ec03e924abdcf /bridge/config/config.go | |
parent | d058be25ad93bf6a0c206ac33ed7db07d1479573 (diff) | |
download | matterbridge-msglm-7e62bc4819f23c57726225916f97c45ed04c60f9.tar.gz matterbridge-msglm-7e62bc4819f23c57726225916f97c45ed04c60f9.tar.bz2 matterbridge-msglm-7e62bc4819f23c57726225916f97c45ed04c60f9.zip |
Remove hyphens when auto-loading envvars from viper config (#545)
* When auto-loading envvars from toml keys, remove hyphens.
See: https://unix.stackexchange.com/questions/23659/can-shell-variable-include-character
Diffstat (limited to 'bridge/config/config.go')
-rw-r--r-- | bridge/config/config.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bridge/config/config.go b/bridge/config/config.go index eff93094..0e36d960 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -186,7 +186,7 @@ func NewConfig(cfgfile string) *Config { viper.SetConfigFile(cfgfile) viper.SetEnvPrefix("matterbridge") viper.AddConfigPath(".") - viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) viper.AutomaticEnv() f, err := os.Open(cfgfile) if err != nil { |