Skip to content

Commit

Permalink
fix spf13#1505 viper.SetConfigFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
MagaSerdarov authored Apr 13, 2023
1 parent adc3a87 commit 24f9ebe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ func (v *Viper) ReadInConfig() error {
v.logger.Debug("reading file", "file", filename)
file, err := afero.ReadFile(v.fs, filename)
if err != nil {
return err
return ConfigFileNotFoundError{v.configName, fmt.Sprintf("%s", v.configPaths)}
}

config := make(map[string]interface{})
Expand Down Expand Up @@ -1593,7 +1593,7 @@ func (v *Viper) MergeInConfig() error {

file, err := afero.ReadFile(v.fs, filename)
if err != nil {
return err
return ConfigFileNotFoundError{v.configName, fmt.Sprintf("%s", v.configPaths)}
}

return v.MergeConfig(bytes.NewReader(file))
Expand Down

0 comments on commit 24f9ebe

Please sign in to comment.