Skip to content

Commit 4e8ef34

Browse files
committed
fix: change file opening mode in SaveJSONLines to truncate file
1 parent 65ae1c4 commit 4e8ef34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fileutil/fileutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func SaveJSONLines(filePath string, data interface{}) error {
169169
return err
170170
}
171171

172-
file, err := os.OpenFile(filePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
172+
file, err := os.OpenFile(filePath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
173173
if err != nil {
174174
return err
175175
}

0 commit comments

Comments
 (0)