Skip to content

Commit

Permalink
refactor: remove unnecessary in writeFile (cosmos#2856)
Browse files Browse the repository at this point in the history
* remove unnecessary

* update
  • Loading branch information
hoangdv2429 authored Dec 22, 2023
1 parent 3d53960 commit 779938c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/e2e/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 779938c

Please sign in to comment.