Commit fd041d91 authored by obscuren's avatar obscuren

Truncate when writing

parent 1549a29c
...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment