Watch config for changes and apply automatically
This commit is contained in:
parent
60d2053894
commit
4a195f8311
1
main.go
1
main.go
@ -40,6 +40,7 @@ func init() {
|
|||||||
viper.AddConfigPath("$HOME/.config")
|
viper.AddConfigPath("$HOME/.config")
|
||||||
viper.SetConfigName("itd")
|
viper.SetConfigName("itd")
|
||||||
viper.SetConfigType("toml")
|
viper.SetConfigType("toml")
|
||||||
|
viper.WatchConfig()
|
||||||
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||||
viper.SetEnvPrefix("itd")
|
viper.SetEnvPrefix("itd")
|
||||||
if err := viper.ReadInConfig(); err != nil {
|
if err := viper.ReadInConfig(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user