]> Cypherpunks.ru repositories - gostls13.git/commitdiff
doc/go1.22: document bufio changes
authorMichael Pratt <mpratt@google.com>
Mon, 11 Dec 2023 21:37:49 +0000 (16:37 -0500)
committerGopher Robot <gobot@golang.org>
Tue, 12 Dec 2023 16:29:33 +0000 (16:29 +0000)
For #61422.

Change-Id: I1b20c536a5b1c105286c84e7c1c7e37eb89bbc93
Reviewed-on: https://go-review.googlesource.com/c/go/+/548879
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

doc/go1.22.html

index fae37143666e1e00c04e6d72493a1362d5ac7603..18d42e5b53c2688ca4cd8d5a2c8efa9cef984402 100644 (file)
@@ -333,8 +333,10 @@ defer func() {
 
 <dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
   <dd>
-    <p><!-- https://go.dev/issue/56381 -->
-      TODO: <a href="https://go.dev/issue/56381">https://go.dev/issue/56381</a>: allow terminating Scanner early cleanly without a final token or an error
+    <p><!-- https://go.dev/issue/56381, CL 498117 -->
+      When a <a href="/pkg/bufio#SplitFunc"><code>SplitFunc</code></a> returns <a href="/pkg/bufio#ErrFinalToken"><code>ErrFinalToken</code></a> with a <code>nil</code> token, <a href="/pkg/bufio#Scanner"><code>Scanner</code></a> will now stop immediately.
+      Previously, it would report a final empty token before stopping, which was usually not desired.
+      Callers that do want to report a final empty token can do so by returning <code>[]byte{}</code> rather than <code>nil</code>.
     </p>
   </dd>
 </dl><!-- bufio -->