TRUNC new file
This commit is contained in:
parent
c1e3282864
commit
a0b6a435a7
|
@ -96,7 +96,7 @@ func loadFile(filename string) ([]byte, error) {
|
||||||
func configWrite(filename string, data []byte) error {
|
func configWrite(filename string, data []byte) error {
|
||||||
fullname := filepath.Join(os.Getenv("FORGE_GOSRC"), filename)
|
fullname := filepath.Join(os.Getenv("FORGE_GOSRC"), filename)
|
||||||
|
|
||||||
cfgfile, err := os.OpenFile(fullname, os.O_RDWR|os.O_CREATE, 0666)
|
cfgfile, err := os.OpenFile(fullname, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
|
||||||
defer cfgfile.Close()
|
defer cfgfile.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("open config file :", err)
|
log.Warn("open config file :", err)
|
||||||
|
|
Loading…
Reference in New Issue