]> Cypherpunks repositories - gostls13.git/commitdiff
bufio: mention ErrFinalToken in SplitFunc documentation
authorMatt Harden <matt.harden@gmail.com>
Fri, 30 Apr 2021 01:34:44 +0000 (01:34 +0000)
committerIan Lance Taylor <iant@golang.org>
Fri, 30 Apr 2021 19:34:38 +0000 (19:34 +0000)
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 <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/bufio/scan.go

index af46a14fbbe0ff9f34680b7e0f6467afa3e207ef..4846d4f733677777a50e24d971cdf643954d4f23 100644 (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