Skip to content

Commit

Permalink
Fix(store): add a file open option to write without remaining data
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkpc138 committed Nov 4, 2024
1 parent 2167a1b commit 96bdf18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/lobster/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func DiskInfo(path string) (cap uint64, used uint64, err error) {
}

func WriteFile(path, fileName string, data []byte) error {
f, err := os.OpenFile(fmt.Sprintf("%s/%s", path, fileName), os.O_WRONLY|os.O_CREATE, 0600)
f, err := os.OpenFile(fmt.Sprintf("%s/%s", path, fileName), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}
Expand Down

0 comments on commit 96bdf18

Please sign in to comment.