From 779938c6d3ab59b948f80b723ac7016b64338ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20Vi=E1=BB=87t=20Ho=C3=A0ng?= Date: Fri, 22 Dec 2023 17:16:54 +0700 Subject: [PATCH] refactor: remove unnecessary in writeFile (#2856) * remove unnecessary * update --- tests/e2e/io.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/e2e/io.go b/tests/e2e/io.go index 40b316bec488e..80353bd5684b6 100644 --- a/tests/e2e/io.go +++ b/tests/e2e/io.go @@ -34,11 +34,8 @@ func copyFile(src, dst string) (int64, error) { //nolint:unparam } // writeFile write a byte slice into a file path +// create the file if it doesn't exist +// NOTE: this file can be write and read by everyone func writeFile(path string, body []byte) error { - _, err := os.Create(path) - if err != nil { - return err - } - - return os.WriteFile(path, body, 0o600) + return os.WriteFile(path, body, 0o666) //nolint:gosec }