From ee60eb814816abff0f067c141691c6a0d185ad46 Mon Sep 17 00:00:00 2001 From: Austin Abro <37223396+AustinAbro321@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:41:07 -0400 Subject: [PATCH] fix: ignore config file not found errors (#2838) Signed-off-by: Austin Abro --- src/cmd/common/viper.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cmd/common/viper.go b/src/cmd/common/viper.go index a28e30544e..e161c22d00 100644 --- a/src/cmd/common/viper.go +++ b/src/cmd/common/viper.go @@ -167,9 +167,11 @@ func printViperConfigUsed() { if !vInitialized { return } - // Optional, so ignore file not found errors - var notFoundErr *viper.ConfigFileNotFoundError - if vConfigError != nil && !errors.As(vConfigError, ¬FoundErr) { + var notFoundErr viper.ConfigFileNotFoundError + if errors.As(vConfigError, ¬FoundErr) { + return + } + if vConfigError != nil { message.WarnErrf(vConfigError, lang.CmdViperErrLoadingConfigFile, vConfigError.Error()) return }