From: Matt Harden Date: Fri, 30 Apr 2021 01:34:44 +0000 (+0000) Subject: bufio: mention ErrFinalToken in SplitFunc documentation X-Git-Tag: go1.17beta1~315 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=93200b98c75500b80a2bf7cc31c2a72deff2741c;p=gostls13.git bufio: mention ErrFinalToken in SplitFunc documentation It is documented elsewhere in the package documentation but this additional mention of it will hopefully reduce confusion. Fixes #44261 Change-Id: I4e9d8f4564ebb7fbe047c92ee2cdffedb39f2a31 GitHub-Last-Rev: 64b6421503dfb9396e46f94f9805ff7f8bf2b31b GitHub-Pull-Request: golang/go#45839 Reviewed-on: https://go-review.googlesource.com/c/go/+/314969 Reviewed-by: Ian Lance Taylor Reviewed-by: Rob Pike --- diff --git a/src/bufio/scan.go b/src/bufio/scan.go index af46a14fbb..4846d4f733 100644 --- a/src/bufio/scan.go +++ b/src/bufio/scan.go @@ -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