Skip to content

Commit

Permalink
doc/go1.18: mention bytes.Cut and strings.Cut
Browse files Browse the repository at this point in the history
For #47694.

Updates #46336.

Change-Id: Ibbd058a1fd4d6b0aa38d3e8dc15b560d1e149f7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/369981
Trust: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
  • Loading branch information
aclements committed Dec 7, 2021
1 parent dc50d69 commit e08d1fb
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions doc/go1.18.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>

<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
Expand All @@ -414,10 +424,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
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 -->

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

<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
Expand All @@ -726,10 +742,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
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 -->

Expand Down

0 comments on commit e08d1fb

Please sign in to comment.