diff --git a/viper.go b/viper.go index 907a102..0d03fa5 100644 --- a/viper.go +++ b/viper.go @@ -1149,6 +1149,13 @@ func (v *Viper) ReadInConfig() error { jww.DEBUG.Println("Reading 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 }