Skip to content

Commit

Permalink
feat: do not return early from old search functions
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <[email protected]>
  • Loading branch information
sagikazarmark committed Jun 4, 2024
1 parent 3faea9d commit 1be81c3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down Expand Up @@ -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 != "" {
Expand Down

0 comments on commit 1be81c3

Please sign in to comment.