From db9c7408abefb627e84fa582fe390d778d2f7ea1 Mon Sep 17 00:00:00 2001 From: Jordan Knott Date: Wed, 19 Aug 2020 00:34:27 -0500 Subject: [PATCH] fix: check error on read config fixes #36 --- internal/commands/commands.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/commands/commands.go b/internal/commands/commands.go index f8b7dc8..c8ec07e 100644 --- a/internal/commands/commands.go +++ b/internal/commands/commands.go @@ -63,7 +63,8 @@ func initConfig() { viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) viper.AutomaticEnv() - if err := viper.ReadInConfig(); err != nil { + err := viper.ReadInConfig() + if _, ok := err.(viper.ConfigFileNotFoundError); !ok { panic(err) } }