diff --git a/atomicfile/atomicfile.go b/atomicfile/atomicfile.go index ec3025340..41c56106a 100644 --- a/atomicfile/atomicfile.go +++ b/atomicfile/atomicfile.go @@ -12,6 +12,7 @@ "io/ioutil" "os" "path/filepath" + "runtime" ) // WriteFile writes data to filename+some suffix, then renames it @@ -31,8 +32,10 @@ func WriteFile(filename string, data []byte, perm os.FileMode) (err error) { if _, err := f.Write(data); err != nil { return err } - if err := f.Chmod(perm); err != nil { - return err + if runtime.GOOS != "windows" { + if err := f.Chmod(perm); err != nil { + return err + } } if err := f.Sync(); err != nil { return err