From: Simon Ruderich Date: Sun, 9 May 2021 10:15:58 +0000 (+0200) Subject: sync: tests: use strict perm for os.WriteFile() in CreateFile() X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=6089e2fbed6bf995122f331ceffcfc8c7b9dda31;p=safcm%2Fsafcm.git sync: tests: use strict perm for os.WriteFile() in CreateFile() This parameter is modified by the umask. The proper permissions are set by os.Chmod() afterwards. Don't confuse the reader by using a value which is not relevant. --- diff --git a/cmd/safcm-remote/sync/filetest/filetest.go b/cmd/safcm-remote/sync/filetest/filetest.go index f0c518c..370ca10 100644 --- a/cmd/safcm-remote/sync/filetest/filetest.go +++ b/cmd/safcm-remote/sync/filetest/filetest.go @@ -97,7 +97,7 @@ func CurrentUserAndGroup() (string, int, string, int) { } func CreateFile(path string, data string, mode fs.FileMode) { - err := os.WriteFile(path, []byte(data), 0644) + err := os.WriteFile(path, []byte(data), 0600) if err != nil { panic(err) }