mirror of
https://github.com/golang/go
synced 2024-11-21 21:24:45 -07:00
Fix incorrect reporting of error in Scanner.next() when Read reads > 0 bytes but returns os.EOF.
R=golang-dev, gri1, gri CC=golang-dev https://golang.org/cl/2083042
This commit is contained in:
parent
3d76135ee5
commit
f8a67d79d1
@ -236,8 +236,10 @@ func (s *Scanner) next() int {
|
||||
if s.srcEnd == 0 {
|
||||
return EOF
|
||||
}
|
||||
s.error(err.String())
|
||||
break
|
||||
if err != os.EOF {
|
||||
s.error(err.String())
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
// at least one byte
|
||||
|
Loading…
Reference in New Issue
Block a user