Skip to content

Commit 08db7c8

Browse files
authored
Ignore io.EOF comparison for (*bufio.Reader).ReadLine (#12)
Although the documentation for (*bufio.Reader).ReadLine do not mention io.EOF explicitly, this function can also return it -- the implementation [1] user ReadSlice() which is documented to return io.EOF. [1] https://golang.org/src/bufio/bufio.go?s=10168:10235#L378 Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent ab96adb commit 08db7c8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

errorlint/allowed.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var allowedErrors = []struct {
1717
{err: "io.EOF", fun: "(*bufio.Reader).Read"},
1818
{err: "io.EOF", fun: "(*bufio.Reader).ReadByte"},
1919
{err: "io.EOF", fun: "(*bufio.Reader).ReadBytes"},
20+
{err: "io.EOF", fun: "(*bufio.Reader).ReadLine"},
2021
{err: "io.EOF", fun: "(*bufio.Reader).ReadSlice"},
2122
{err: "io.EOF", fun: "(*bufio.Reader).ReadString"},
2223
{err: "io.EOF", fun: "(*bufio.Scanner).Scan"},

0 commit comments

Comments
 (0)