From e0a70411dd82ccce5b656dd51f39077b41fd267a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 1 Nov 2020 15:50:08 -0500 Subject: [PATCH] fix: create the file if it does not exist --- plugins/common/io.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/common/io.go b/plugins/common/io.go index 79e98452b..2918284f8 100644 --- a/plugins/common/io.go +++ b/plugins/common/io.go @@ -172,7 +172,7 @@ func SetPermissions(path string, fileMode os.FileMode) error { // WriteSliceToFile writes a slice of strings to a file func WriteSliceToFile(filename string, lines []string) error { - file, err := os.OpenFile(filename, os.O_RDWR|os.O_TRUNC, 0600) + file, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { return err }