bufio: SplitFunc documentation does not document ErrFinalToken #44261
Labels
Documentation
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What did you do?
I went to https://golang.org/pkg/bufio/#SplitFunc and read the documentation to implement a
SplitFunc
. In my implementation of aSplitFunc
, for the case of atEOF, I simply returnedlen(data), data, nil
thinking theScanner
would stop calling my function. It didn't (I was gettingpanic: bufio.Scan: too many empty tokens without progressing
). I went back and looked at the "EmptyFinalToken" example here. It refered toErrFinalToken
which I was surprised to see since it wasn't mentioned in theSplitFunc
documentation.What did you expect to see?
I'd expect the
SplitFunc
documentation to include a reference toErrFinalToken
.What did you see instead?
No reference to it at all.
The text was updated successfully, but these errors were encountered: