Skip to content

Commit 1649e35

Browse files
authored
Use os.Create to truncate the results file if a previous one exists. (#940)
Signed-off-by: Caleb Brown <[email protected]>
1 parent a127b25 commit 1649e35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/worker/runstatic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func RunStaticAnalysis(ctx context.Context, pkg *pkgmanager.Pkg, sbOpts []sandbo
5555
}
5656

5757
// create the results JSON file as an empty file, so it can be mounted into the container
58-
resultsFile, err := os.OpenFile(resultsJSONFile, os.O_RDONLY|os.O_CREATE, 0o644)
58+
resultsFile, err := os.Create(resultsJSONFile)
5959
if err != nil {
6060
return nil, "", fmt.Errorf("could not create results JSON file: %w", err)
6161
}

0 commit comments

Comments
 (0)