mirror of
https://github.com/arnaucube/go-ethereum.git
synced 2026-02-28 05:56:45 +01:00
Truncate when writing
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user