fix viper config write permissions

This commit is contained in:
Andrey Odintsov 2019-02-28 15:33:48 +03:00
parent 8b9fb57d30
commit f645e234c6
2 changed files with 1 additions and 2 deletions

1
go.mod
View file

@ -6,7 +6,6 @@ require (
github.com/coreos/go-systemd v0.0.0-20190212144455-93d5ec2c7f76 // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/ghodss/yaml v1.0.0
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect

View file

@ -1360,7 +1360,7 @@ func (v *Viper) writeConfig(filename string, force bool) error {
return fmt.Errorf("File: %s exists. Use WriteConfig to overwrite.", filename)
}
}
f, err := v.fs.OpenFile(filename, flags, os.FileMode(0644))
f, err := v.fs.OpenFile(filename, flags, os.FileMode(0664))
if err != nil {
return err
}