From 1be81c313adc89f18fec4a7f954ce4e52a37e1d7 Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Tue, 4 Jun 2024 13:32:27 +0200 Subject: [PATCH] feat: do not return early from old search functions Signed-off-by: Mark Sagi-Kazar --- viper.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/viper.go b/viper.go index 1ddeb2c..472fd59 100644 --- a/viper.go +++ b/viper.go @@ -509,9 +509,7 @@ func AddConfigPath(in string) { v.AddConfigPath(in) } func (v *Viper) AddConfigPath(in string) { if v.finder != nil { - v.logger.Warn("call to AddConfigPath is ineffective when a custom finder is configured") - - return + v.logger.Warn("ineffective call to function: custom finder takes precedence", slog.String("function", "AddConfigPath")) } if in != "" { @@ -1964,9 +1962,7 @@ func SetConfigName(in string) { v.SetConfigName(in) } func (v *Viper) SetConfigName(in string) { if v.finder != nil { - v.logger.Warn("call to SetConfigName is ineffective when a custom finder is configured") - - return + v.logger.Warn("ineffective call to function: custom finder takes precedence", slog.String("function", "SetConfigName")) } if in != "" {