chore: Nested if can be replaced with else-if
This commit is contained in:
parent
56d0eb0e6a
commit
f34deb0eac
|
@ -270,11 +270,9 @@ func LoadConf(confPath string) (ConfYaml, error) {
|
||||||
// If a config file is found, read it in.
|
// If a config file is found, read it in.
|
||||||
if err := viper.ReadInConfig(); err == nil {
|
if err := viper.ReadInConfig(); err == nil {
|
||||||
fmt.Println("Using config file:", viper.ConfigFileUsed())
|
fmt.Println("Using config file:", viper.ConfigFileUsed())
|
||||||
} else {
|
} else if err := viper.ReadConfig(bytes.NewBuffer(defaultConf)); err != nil {
|
||||||
// load default config
|
// load default config
|
||||||
if err := viper.ReadConfig(bytes.NewBuffer(defaultConf)); err != nil {
|
return conf, err
|
||||||
return conf, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue