Skip to content

Commit

Permalink
fix: panic(nil) on loadConfig if config actually exists
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanKnott committed Aug 22, 2020
1 parent 7a6609a commit 5ceafd5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ func initConfig() {
viper.AutomaticEnv()

err := viper.ReadInConfig()
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
if err == nil {
return
}
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
panic(err)
}
}
Expand Down

0 comments on commit 5ceafd5

Please sign in to comment.