Update test output

This commit is contained in:
Owen Mansel-Chan
2026-06-04 13:52:05 +01:00
parent 14e3ee2fb0
commit c170002fb1
2 changed files with 2 additions and 5 deletions

View File

@@ -50,6 +50,3 @@ nodes
| tests.go:162:2:162:74 | ... := ...[0] | semmle.label | ... := ...[0] |
| tests.go:166:8:166:8 | f | semmle.label | f |
subpaths
testFailures
| tests.go:109:94:109:114 | comment | Fixed spurious result: Source |
| tests.go:112:19:112:38 | comment | Fixed spurious result: Alert |

View File

@@ -106,10 +106,10 @@ func deferredCloseWithSync() {
func deferredCloseWithSync2() {
// open file for writing
if f, err := os.OpenFile("foo.txt", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0666); err != nil { // $ SPURIOUS: Source
if f, err := os.OpenFile("foo.txt", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0666); err != nil {
// a call to `Close` is deferred, but we have a call to `Sync` later which
// precedes the call to `Close` during execution
defer f.Close() // $ SPURIOUS: Alert
defer f.Close()
if err := f.Sync(); err != nil {
log.Fatal(err)