mirror of
https://github.com/spf13/viper
synced 2025-04-29 00:37:17 +00:00
Merge 92882dd559
into 1508a7ba44
This commit is contained in:
commit
96a5a9a05b
1 changed files with 5 additions and 0 deletions
5
viper.go
5
viper.go
|
@ -1491,6 +1491,11 @@ func (v *Viper) ReadInConfig() error {
|
|||
return UnsupportedConfigError(v.getConfigType())
|
||||
}
|
||||
|
||||
fileExist, err := afero.Exists(v.fs, filename)
|
||||
if !fileExist {
|
||||
return ConfigFileNotFoundError{filename, fmt.Sprintf("%s", v.configPaths)}
|
||||
}
|
||||
|
||||
v.logger.Debug("reading file", "file", filename)
|
||||
file, err := afero.ReadFile(v.fs, filename)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue