From ba72820f7ab296425ceeb7b7a8d6f4e1795e3c11 Mon Sep 17 00:00:00 2001 From: Jaran Charumilind Date: Wed, 12 May 2021 14:59:11 -0700 Subject: [PATCH] Exclude (*Pipe{Read,Write}r).CloseWithError --- errcheck/errcheck.go | 4 ++++ testdata/main.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/errcheck/errcheck.go b/errcheck/errcheck.go index 724e3e8..7697048 100644 --- a/errcheck/errcheck.go +++ b/errcheck/errcheck.go @@ -51,6 +51,10 @@ var ( "fmt.Fprintf(os.Stderr)", "fmt.Fprintln(os.Stderr)", + // io + "(*io.PipeReader).CloseWithError", + "(*io.PipeWriter).CloseWithError", + // math/rand "math/rand.Read", "(*math/rand.Rand).Read", diff --git a/testdata/main.go b/testdata/main.go index 48d2c3b..44d4ac4 100644 --- a/testdata/main.go +++ b/testdata/main.go @@ -4,6 +4,7 @@ import ( "bytes" "crypto/sha256" "fmt" + "io" "io/ioutil" "math/rand" mrand "math/rand" @@ -147,6 +148,9 @@ func main() { rand.Read(nil) mrand.Read(nil) sha256.New().Write([]byte{}) + pr, pw := io.Pipe() + pr.CloseWithError(nil) + pw.CloseWithError(nil) ioutil.ReadFile("main.go") // UNCHECKED