Austin Clements submitted this change.
doc/go1.18: mention bytes.Cut and strings.Cut
For #47694.
Updates #46336.
Change-Id: Ibbd058a1fd4d6b0aa38d3e8dc15b560d1e149f7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/369981
Trust: Austin Clements <aus...@google.com>
Reviewed-by: Jeremy Faller <jer...@golang.org>
---
M doc/go1.18.html
1 file changed, 36 insertions(+), 8 deletions(-)
diff --git a/doc/go1.18.html b/doc/go1.18.html
index 8131aff..06c6786 100644
--- a/doc/go1.18.html
+++ b/doc/go1.18.html
@@ -403,6 +403,16 @@
<dl id="bytes"><dt><a href="/pkg/bytes/">bytes</a></dt>
<dd>
+ <p><!-- CL 351710 -->
+ The new <a href="/pkg/bytes/#Cut"><code>Cut</code></a> function
+ slices a <code>[]byte</code> around a separator. It can replace
+ and simplify many common uses of
+ <a href="/pkg/bytes/#Index"><code>Index</code></a>,
+ <a href="/pkg/bytes/#IndexByte"><code>IndexByte</code></a>,
+ <a href="/pkg/bytes/#IndexRune"><code>IndexRune</code></a>,
+ and <a href="/pkg/bytes/#SplitN"><code>SplitN</code></a>.
+ </p>
+
<p><!-- CL 323318, CL 332771 -->
<a href="/pkg/bytes/#Trim"><code>Trim</code></a>, <a href="/pkg/bytes/#TrimLeft"><code>TrimLeft</code></a>,
and <a href="/pkg/bytes/#TrimRight"><code>TrimRight</code></a> are now allocation free and, especially for
@@ -414,10 +424,6 @@
handle Unicode punctuation and language-specific capitalization rules, and is superseded by the
<a href="https://golang.org/x/text/cases">golang.org/x/text/cases</a> package.
</p>
-
- <p><!-- CL 351710 -->
- TODO: bytes.Cut.
- </p>
</dd>
</dl><!-- bytes -->
@@ -709,6 +715,16 @@
<dl id="strings"><dt><a href="/pkg/strings/">strings</a></dt>
<dd>
+ <p><!-- CL 351710 -->
+ The new <a href="/pkg/strings/#Cut"><code>Cut</code></a> function
+ slices a <code>string</code> around a separator. It can replace
+ and simplify many common uses of
+ <a href="/pkg/strings/#Index"><code>Index</code></a>,
+ <a href="/pkg/strings/#IndexByte"><code>IndexByte</code></a>,
+ <a href="/pkg/strings/#IndexRune"><code>IndexRune</code></a>,
+ and <a href="/pkg/strings/#SplitN"><code>SplitN</code></a>.
+ </p>
+
<p><!-- CL 345849 -->
The new <a href="/pkg/strings/#Clone"><code>Clone</code></a> function copies the input
<code>string</code> without the returned cloned <code>string</code> referencing
@@ -726,10 +742,6 @@
handle Unicode punctuation and language-specific capitalization rules, and is superseded by the
<a href="https://golang.org/x/text/cases">golang.org/x/text/cases</a> package.
</p>
-
- <p><!-- CL 351710 -->
- TODO: strings.Cut.
- </p>
</dd>
</dl><!-- strings -->
To view, visit change 369981. To unsubscribe, or for help writing mail filters, visit settings.