]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.21: mention regexp.MarshalText and UnmarshalText
authorIan Lance Taylor <iant@golang.org>
Fri, 26 May 2023 21:16:24 +0000 (14:16 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 26 May 2023 23:31:22 +0000 (23:31 +0000)
For #46159

Change-Id: Ia9cc0827a89d362532d1a662b791de8eebbfb2fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/498756
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

doc/go1.21.html

index 21d2b35eaf1b9e0dcf9735d886ccc4cf5a2ac2b7..b959cdb116237df2c047dc13b231c2e2fb0d33e1 100644 (file)
@@ -667,12 +667,16 @@ Do not send CLs removing the interior tags from such phrases.
 
 <dl id="regexp"><dt><a href="/pkg/regexp/">regexp</a></dt>
   <dd>
-    <p><!-- https://go.dev/issue/46159 -->
-      TODO: <a href="https://go.dev/issue/46159">https://go.dev/issue/46159</a>: support encoding.TextMarshaler
-    </p>
-
-    <p><!-- CL 479401 -->
-      TODO: <a href="https://go.dev/cl/479401">https://go.dev/cl/479401</a>: regexp: add Regexp.TextMarshaler/TextUnmarshaler; modified api/next/46159.txt
+    <p><!-- https://go.dev/issue/46159, CL 479401 -->
+      <a href="/pkg/regexp#Regexp"><code>Regexp</code></a> now defines
+      <a href="/pkg/regexp#Regexp.MarshalText"><code>MarshalText</code></a>
+      and <a href="/pkg/regexp#Regexp.UnmarshalText"><code>UnmarshalText</code></a>
+      methods. These implement
+      <a href="/pkg/encoding#TextMarshaler"><code>encoding.TextMarshaler</code></a>
+      and
+      <a href="/pkg/encoding#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>
+      and will be used by packages such as
+      <a href="/pkg/encoding/json">encoding/json</a>.
     </p>
   </dd>
 </dl><!-- regexp -->