diff --git a/config/config.go b/config/config.go index 7210c7c..6a761d5 100644 --- a/config/config.go +++ b/config/config.go @@ -270,11 +270,9 @@ func LoadConf(confPath string) (ConfYaml, error) { // If a config file is found, read it in. if err := viper.ReadInConfig(); err == nil { fmt.Println("Using config file:", viper.ConfigFileUsed()) - } else { + } else if err := viper.ReadConfig(bytes.NewBuffer(defaultConf)); err != nil { // load default config - if err := viper.ReadConfig(bytes.NewBuffer(defaultConf)); err != nil { - return conf, err - } + return conf, err } }