good morning!!!!

Skip to content
Snippets Groups Projects
Commit fd041d91 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

Truncate when writing

parent 1549a29c
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ func ReadAllFile(filePath string) (string, error) { ...@@ -45,7 +45,7 @@ func ReadAllFile(filePath string) (string, error) {
} }
func WriteFile(filePath string, content []byte) error { func WriteFile(filePath string, content []byte) error {
fh, err := os.OpenFile(filePath, os.O_RDWR|os.O_CREATE, os.ModePerm) fh, err := os.OpenFile(filePath, os.O_TRUNC|os.O_RDWR|os.O_CREATE, os.ModePerm)
if err != nil { if err != nil {
return err return err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment