fix: rewrite output files

This commit is contained in:
sajadMRjl
2026-01-28 15:56:15 +03:30
parent 1b849aaf83
commit 7cfd20d639
3 changed files with 52 additions and 8 deletions

View File

@@ -45,7 +45,7 @@ type TextWriter struct {
func NewText(path string) (*TextWriter, error) {
// We use O_APPEND | O_CREATE | O_WRONLY
f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
f, err := os.OpenFile(path, os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
return nil, err
}