overwrite output file, do not append to it

This commit is contained in:
Steven Polley 2024-11-05 22:15:21 -07:00
parent f7a2922d7d
commit c90a3c0543

View File

@ -64,7 +64,7 @@ func main() {
return outRows[i].NumberQueries < outRows[j].NumberQueries return outRows[i].NumberQueries < outRows[j].NumberQueries
}) })
f, err := os.OpenFile(*outFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0600) f, err := os.OpenFile(*outFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil { if err != nil {
log.Fatalf("failed to open output file '%s': %v", *outFile, err) log.Fatalf("failed to open output file '%s': %v", *outFile, err)
} }