Skip to content

Commit e08d1fb

Browse files
committed
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 <[email protected]> Reviewed-by: Jeremy Faller <[email protected]>
1 parent dc50d69 commit e08d1fb

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

doc/go1.18.html

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
403403

404404
<dl id="bytes"><dt><a href="/pkg/bytes/">bytes</a></dt>
405405
<dd>
406+
<p><!-- CL 351710 -->
407+
The new <a href="/pkg/bytes/#Cut"><code>Cut</code></a> function
408+
slices a <code>[]byte</code> around a separator. It can replace
409+
and simplify many common uses of
410+
<a href="/pkg/bytes/#Index"><code>Index</code></a>,
411+
<a href="/pkg/bytes/#IndexByte"><code>IndexByte</code></a>,
412+
<a href="/pkg/bytes/#IndexRune"><code>IndexRune</code></a>,
413+
and <a href="/pkg/bytes/#SplitN"><code>SplitN</code></a>.
414+
</p>
415+
406416
<p><!-- CL 323318, CL 332771 -->
407417
<a href="/pkg/bytes/#Trim"><code>Trim</code></a>, <a href="/pkg/bytes/#TrimLeft"><code>TrimLeft</code></a>,
408418
and <a href="/pkg/bytes/#TrimRight"><code>TrimRight</code></a> are now allocation free and, especially for
@@ -414,10 +424,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
414424
handle Unicode punctuation and language-specific capitalization rules, and is superseded by the
415425
<a href="https://golang.org/x/text/cases">golang.org/x/text/cases</a> package.
416426
</p>
417-
418-
<p><!-- CL 351710 -->
419-
TODO: bytes.Cut.
420-
</p>
421427
</dd>
422428
</dl><!-- bytes -->
423429

@@ -709,6 +715,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
709715

710716
<dl id="strings"><dt><a href="/pkg/strings/">strings</a></dt>
711717
<dd>
718+
<p><!-- CL 351710 -->
719+
The new <a href="/pkg/strings/#Cut"><code>Cut</code></a> function
720+
slices a <code>string</code> around a separator. It can replace
721+
and simplify many common uses of
722+
<a href="/pkg/strings/#Index"><code>Index</code></a>,
723+
<a href="/pkg/strings/#IndexByte"><code>IndexByte</code></a>,
724+
<a href="/pkg/strings/#IndexRune"><code>IndexRune</code></a>,
725+
and <a href="/pkg/strings/#SplitN"><code>SplitN</code></a>.
726+
</p>
727+
712728
<p><!-- CL 345849 -->
713729
The new <a href="/pkg/strings/#Clone"><code>Clone</code></a> function copies the input
714730
<code>string</code> without the returned cloned <code>string</code> referencing
@@ -726,10 +742,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
726742
handle Unicode punctuation and language-specific capitalization rules, and is superseded by the
727743
<a href="https://golang.org/x/text/cases">golang.org/x/text/cases</a> package.
728744
</p>
729-
730-
<p><!-- CL 351710 -->
731-
TODO: strings.Cut.
732-
</p>
733745
</dd>
734746
</dl><!-- strings -->
735747

0 commit comments

Comments
 (0)