From e42ef59d0a7db0af8389e6234ce9f0c13674a253 Mon Sep 17 00:00:00 2001 From: Matthew Rose Date: Sun, 14 Nov 2021 12:38:35 +1000 Subject: [PATCH] fix: overwrite output file Signed-off-by: Matthew Rose --- pkg/writer/writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/writer/writer.go b/pkg/writer/writer.go index 1f20394..bf59e21 100644 --- a/pkg/writer/writer.go +++ b/pkg/writer/writer.go @@ -40,7 +40,7 @@ type fileWriter struct { } func (fw fileWriter) Write(content []byte) (n int, err error) { - f, err := os.OpenFile(fw.file, os.O_RDWR|os.O_CREATE, 0644) + f, err := os.OpenFile(fw.file, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644) if err != nil { return 0, errors.Wrap(err, fmt.Sprintf("couldn't open file: %s", fw.file)) }