Mentions ErrFinalToken in SplitFunc documentation

A custom split function may return ErrFinalToken to trigger special processing. This is documented in the package documentation but not in that of SplitFunc itself. This short mention of it will hopefully reduce confusion.

Fixes golang#44261
This commit is contained in:
Matt Harden 2021-04-28 19:55:04 -07:00 committed by GitHub
parent 756fd56bbf
commit 64b6421503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -48,7 +48,8 @@ type Scanner struct {
// and the next token to return to the user, if any, plus an error, if any.
//
// Scanning stops if the function returns an error, in which case some of
// the input may be discarded.
// the input may be discarded. If that error is ErrFinalToken, scanning
// stops with no error.
//
// Otherwise, the Scanner advances the input. If the token is not nil,
// the Scanner returns it to the user. If the token is nil, the