]> Cypherpunks repositories - gostls13.git/commitdiff
doc: add release notes for new context functions
authorDamien Neil <dneil@google.com>
Wed, 19 Apr 2023 19:31:27 +0000 (12:31 -0700)
committerSameer Ajmani <sameer@golang.org>
Thu, 20 Apr 2023 13:01:21 +0000 (13:01 +0000)
For #40221
For #56661
For #57928

Change-Id: Iaf7425bb26eeb9c23235d13c786d5bb572159481
Reviewed-on: https://go-review.googlesource.com/c/go/+/486535
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Sameer Ajmani <sameer@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

doc/go1.21.html

index 911a8ddd19a5611847507018515967ef539cf9a4..e5c49912ddb75daee49a9ba2086f2a5e8406da52 100644 (file)
@@ -84,6 +84,27 @@ Do not send CLs removing the interior tags from such phrases.
   TODO: complete this section
 </p>
 
+<dl id="context"><dt><a href="/pkg/context/">sync</a></dt>
+  <dd>
+    <p><!-- https://go.dev/issue/40221, CL 479918 -->
+      The new <a href="/pkg/context/#WithoutCancel"><code>WithoutCancel</code></a>
+      function returns a copy of a context that is not canceled when the original
+      context is canceled.
+    </p>
+    <p><!-- https://go.dev/issue/56661, CL 449318 -->
+      The new <a href="/pkg/context/#WithDeadlineCause"><code>WithDeadlineCause</code></a>
+      and <a href="/pkg/context/#WithTimeoutCause"><code>WithTimeoutCause</code></a>
+      functions provide a way to set a context cancellation cause when a deadline or
+      timer expires. The cause may be retrieved with the
+      <a href="/pkg/context/#Cause"><code>Cause</code></a> function.
+    </p>
+    <p><!-- https://go.dev/issue/57928, CL 482695 -->
+      The new <a href="/pkg/context/#AfterFunc"><code>AfterFunc</code></a>
+      function registers a function to run after a context has been cancelled.
+    </p>
+  </dd>
+</dl>
+
 <dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
   <dd>
     <p><!-- https://go.dev/issue/56102, CL 451356 -->