From 7dc02eb5a5bea800a632c6fd28d94e7b971d81b1 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Mon, 11 Dec 2023 16:37:49 -0500 Subject: [PATCH] doc/go1.22: document bufio changes For #61422. Change-Id: I1b20c536a5b1c105286c84e7c1c7e37eb89bbc93 Reviewed-on: https://go-review.googlesource.com/c/go/+/548879 Reviewed-by: Michael Knyszek Auto-Submit: Michael Pratt LUCI-TryBot-Result: Go LUCI --- doc/go1.22.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/go1.22.html b/doc/go1.22.html index fae37143666e1..18d42e5b53c26 100644 --- a/doc/go1.22.html +++ b/doc/go1.22.html @@ -333,8 +333,10 @@

Minor changes to the library

bufio
-

- TODO: https://go.dev/issue/56381: allow terminating Scanner early cleanly without a final token or an error +

+ When a SplitFunc returns ErrFinalToken with a nil token, Scanner 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 []byte{} rather than nil.