Skip to content

Commit

Permalink
fix: overwrite output file
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Rose <[email protected]>
  • Loading branch information
matty-rose committed Nov 14, 2021
1 parent d9cbbef commit e42ef59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/writer/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit e42ef59

Please sign in to comment.