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:
parent
3d76135ee5
commit
f8a67d79d1
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user