We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
io.ReadFull
io.EOF
1 parent 0716d34 commit 6ed951fCopy full SHA for 6ed951f
errorlint/allowed.go
@@ -40,6 +40,7 @@ var allowedErrors = []struct {
40
{err: "io.ErrClosedPipe", fun: "(*io.PipeWriter).Write"},
41
{err: "io.ErrShortBuffer", fun: "io.ReadAtLeast"},
42
{err: "io.ErrUnexpectedEOF", fun: "io.ReadAtLeast"},
43
+ {err: "io.EOF", fun: "io.ReadFull"},
44
{err: "io.ErrUnexpectedEOF", fun: "io.ReadFull"},
45
// pkg/net/http
46
{err: "http.ErrServerClosed", fun: "(*net/http.Server).ListenAndServe"},
errorlint/testdata/src/allowed/allowed.go
@@ -102,6 +102,9 @@ func IoReadAtLeast(r io.Reader) {
102
func IoReadFull(r io.Reader) {
103
var buf [4096]byte
104
_, err := io.ReadFull(r, buf[:])
105
+ if err == io.EOF {
106
+ fmt.Println(err)
107
+ }
108
if err == io.ErrUnexpectedEOF {
109
fmt.Println(err)
110
}
0 commit comments