bufio: bug in the emptyFinalToken example for Scanner #25909
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The
SplitFunc
in theemptyFinalToken
example forbufio.Scanner
doesn't handle the case of requesting more data if necessary.The example only happens to work because the whole input is returned by a single call to
Read
(it uses astrings.Reader
).This should be enough to fix it:
The problem is demonstrated here:
https://play.golang.org/p/CM-sWovg8mg
The text was updated successfully, but these errors were encountered: