Skip to content

Commit

Permalink
Merge pull request #7 from klausman/outputtrunc
Browse files Browse the repository at this point in the history
output to file: Truncate output file on open
  • Loading branch information
hdm authored Aug 12, 2024
2 parents 7c372f9 + 77aa408 commit 7c24fa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/cmd_scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func runScan(cmd *cobra.Command, args []string) {
case "stderr":
outputWriter = os.Stderr
default:
outputWriter, err = os.OpenFile(gOutput, os.O_WRONLY|os.O_CREATE, 0o600)
outputWriter, err = os.OpenFile(gOutput, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600)
if err != nil {
conf.Logger.Fatalf("failed to create output file %s: %v", gOutput, err)
}
Expand Down

0 comments on commit 7c24fa7

Please sign in to comment.