From c90a3c054368c73dcacc61d1fffa202eba1da8ad Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Tue, 5 Nov 2024 22:15:21 -0700 Subject: [PATCH] overwrite output file, do not append to it --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index e0c44a6..29cea99 100644 --- a/main.go +++ b/main.go @@ -64,7 +64,7 @@ func main() { 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 { log.Fatalf("failed to open output file '%s': %v", *outFile, err) }