diff --git a/ethutil/path.go b/ethutil/path.go index 27022bcfa45b6b05c274e7e5f9f5b84e4be234b2..cfbc389508cc1517da208e0844db064fcc51206a 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 }