fix: panic(nil) on loadConfig if config actually exists

This commit is contained in:
Jordan Knott 2020-08-21 23:29:08 -05:00
parent 7a6609ae75
commit 5ceafd556a

View File

@ -56,7 +56,10 @@ func initConfig() {
viper.AutomaticEnv() viper.AutomaticEnv()
err := viper.ReadInConfig() err := viper.ReadInConfig()
if _, ok := err.(viper.ConfigFileNotFoundError); !ok { if err == nil {
return
}
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
panic(err) panic(err)
} }
} }