1
0
Fork 0
mirror of https://github.com/spf13/viper synced 2025-05-29 07:27:18 +00:00

fix cannot write hidden file without extension ()

This commit is contained in:
Séra Zoltán 2021-01-15 15:19:47 +02:00
parent b56493f90a
commit a5b23ef0de

View file

@ -1537,7 +1537,7 @@ func (v *Viper) writeConfig(filename string, force bool) error {
var configType string var configType string
ext := filepath.Ext(filename) ext := filepath.Ext(filename)
if ext != "" { if ext != "" && ext != filepath.Base(filename) {
configType = ext[1:] configType = ext[1:]
} else { } else {
configType = v.configType configType = v.configType