scanner: Don't call unread() after reading EOF.
This fixes the TestScanDigitsUnread() unit test.
This commit is contained in:
parent
cade852d47
commit
23ed7ba25b
@ -552,7 +552,7 @@ func (s *Scanner) scanDigits(ch rune, base, n int) rune {
|
||||
s.err("illegal char escape")
|
||||
}
|
||||
|
||||
if n != start {
|
||||
if n != start && ch != eof {
|
||||
// we scanned all digits, put the last non digit char back,
|
||||
// only if we read anything at all
|
||||
s.unread()
|
||||
|
Loading…
Reference in New Issue
Block a user