mirror of
https://github.com/spf13/viper
synced 2025-04-28 16:27:17 +00:00
Merge 630d0d3b29
into 1508a7ba44
This commit is contained in:
commit
55c969ac76
1 changed files with 7 additions and 0 deletions
7
viper.go
7
viper.go
|
@ -1494,6 +1494,13 @@ func (v *Viper) ReadInConfig() error {
|
|||
v.logger.Debug("reading file", "file", filename)
|
||||
file, err := afero.ReadFile(v.fs, filename)
|
||||
if err != nil {
|
||||
fileExt := filepath.Ext(filename)
|
||||
|
||||
if stringInSlice(fileExt, SupportedExts) {
|
||||
log.Println("warning:", "Looks like you have included the file extention in the file name."+
|
||||
"Consider using SetConfigType method instead.")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue