polyfloyd / go-errorlint

A source code linter that can be used to find code that will cause problems with Go's error wrapping scheme
MIT License
248 stars 19 forks source link

Ignore io.EOF comparison for (*bufio.Reader).ReadLine #12

Closed kolyshkin closed 3 years ago

kolyshkin commented 3 years ago

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

Found in https://github.com/opencontainers/runc/pull/3062/commits/02c23c4c13ec65bb0872484905c01064c31c74ae

Signed-off-by: Kir Kolyshkin kolyshkin@gmail.com

polyfloyd commented 3 years ago

Thanks!