Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1a79d23

Browse files
committedFeb 19, 2025·
tests: update errcheck tests
1 parent b574814 commit 1a79d23

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎pkg/golinters/errcheck/testdata/errcheck.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func IgnoreCloseMissingErrHandling() error {
2121
return err
2222
}
2323

24-
f.Close()
24+
f.Close() // want "Error return value of `f.Close` is not checked"
2525
return nil
2626
}
2727

@@ -30,14 +30,14 @@ func IgnoreCloseInDeferMissingErrHandling() {
3030
if err != nil {
3131
panic(err)
3232
}
33-
defer resp.Body.Close()
33+
defer resp.Body.Close() // want "Error return value of `resp.Body.Close` is not checked"
3434

3535
panic(resp)
3636
}
3737

3838
func IgnoreStdxWrite() {
39-
os.Stdout.Write([]byte{})
40-
os.Stderr.Write([]byte{})
39+
os.Stdout.Write([]byte{}) // want "Error return value of `os.Stdout.Write` is not checked"
40+
os.Stderr.Write([]byte{}) // want "Error return value of `os.Stderr.Write` is not checked"
4141
}
4242

4343
func IgnoreBufferWrites(buf *bytes.Buffer) {

0 commit comments

Comments
 (0)
Please sign in to comment.