1
0
mirror of https://github.com/golang/go synced 2024-11-12 10:30:23 -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:
Kyle Consalus 2010-09-01 15:15:37 -07:00 committed by Robert Griesemer
parent 3d76135ee5
commit f8a67d79d1

View File

@ -236,8 +236,10 @@ func (s *Scanner) next() int {
if s.srcEnd == 0 { if s.srcEnd == 0 {
return EOF return EOF
} }
s.error(err.String()) if err != os.EOF {
break s.error(err.String())
break
}
} }
} }
// at least one byte // at least one byte