diff options
author | siddharth <s@ricketyspace.net> | 2021-11-28 21:48:22 -0500 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2021-11-28 21:48:22 -0500 |
commit | 7defbcb1d9ed71d09c9f987ffa3df2f3e398e19a (patch) | |
tree | 2a4d09800ad6c0606f74a0e8dcbb9487b923cfff | |
parent | 88c18f5fab00d9caf809c28f980e6603d2959311 (diff) |
db: update FernDB.Write
Always truncate file before writing.
-rw-r--r-- | db/db.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -102,7 +102,7 @@ func (fdb *FernDB) Write() error { return fmt.Errorf("FernDB path not set") } - f, err := os.OpenFile(dbPath, os.O_WRONLY|os.O_CREATE, 0644) + f, err := os.OpenFile(dbPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) if err != nil { return err } |