mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-04 15:22:55 +00:00
Truncate when writing
This commit is contained in:
parent
1549a29c9d
commit
fd041d91ee
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue