]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.18: mention bytes.Cut and strings.Cut
authorAustin Clements <austin@google.com>
Tue, 7 Dec 2021 19:51:45 +0000 (14:51 -0500)
committerAustin Clements <austin@google.com>
Tue, 7 Dec 2021 21:32:48 +0000 (21:32 +0000)
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>
doc/go1.18.html

index 8131afffdbc08f9c6d8c9f8e1d4cd1852dd6fb19..06c6786bf290628c51a7315c506660ade80806e8 100644 (file)
@@ -403,6 +403,16 @@ Do not send CLs removing the interior tags from such phrases.
 
 <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 @@ Do not send CLs removing the interior tags from such phrases.
       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 @@ Do not send CLs removing the interior tags from such phrases.
 
 <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 @@ Do not send CLs removing the interior tags from such phrases.
       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 -->