Skip to content

Commit

Permalink
doc/go1.22: document bufio changes
Browse files Browse the repository at this point in the history
For golang#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>
  • Loading branch information
prattmic authored and ezz-no committed Feb 17, 2024
1 parent 2440c77 commit 7dc02eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/go1.22.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,10 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>

<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 -->
Expand Down

0 comments on commit 7dc02eb

Please sign in to comment.