util: Generalize the file mode of 0666 with util.FileMode

This commit is contained in:
Jöran Karl
2024-05-30 21:14:04 +02:00
parent 69064cf808
commit 18a81f043c
6 changed files with 12 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ func (NullWriter) Write(data []byte) (n int, err error) {
// InitLog sets up the debug log system for micro if it has been enabled by compile-time variables
func InitLog() {
if util.Debug == "ON" {
f, err := os.OpenFile("log.txt", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
f, err := os.OpenFile("log.txt", os.O_RDWR|os.O_CREATE|os.O_TRUNC, util.FileMode)
if err != nil {
log.Fatalf("error opening file: %v", err)
}