Closed
Description
I have previously submitted #12 hoping it would fix to eliminate a bogus error in my code.
Today I found it did not.
The following code is fine (i.e. no warnings):
func UseBufioReadLine(r io.Reader) error {
rd := bufio.NewReader(r)
for {
_, _, err := rd.ReadLine()
if err != nil {
if err == io.EOF {
err = nil
}
}
return err
}
}
but if we modify it in this way:
func UseBufioReadLine(r io.Reader) error {
rd := bufio.NewReader(r)
+ var err error
for {
- _, _, err := rd.ReadLine()
+ _, _, err = rd.ReadLine()
if err != nil {
if err == io.EOF {
we will have something like
func UseBufioReadLine(r io.Reader) error {
rd := bufio.NewReader(r)
var err error
for {
_, _, err = rd.ReadLine()
if err != nil {
if err == io.EOF {
err = nil
}
}
return err
}
}
and this code results in a warning:
comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error
Alas, I don't know internals good enough to try to fix it.