From fd041d91ee9f4be2d4705a32dc16698c89622c85 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 17 Sep 2014 15:57:07 +0200 Subject: [PATCH] Truncate when writing --- ethutil/path.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethutil/path.go b/ethutil/path.go index 27022bcfa..cfbc38950 100644 --- a/ethutil/path.go +++ b/ethutil/path.go @@ -45,7 +45,7 @@ func ReadAllFile(filePath string) (string, 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 { return err }