Skip to content

Commit f5015b5

Browse files
ianlancetaylorSajmani
authored andcommitted
doc/go1.21: context.Background and TODO may now appear equal
Fixes #60978 Change-Id: I3e4bd366dc30ac435698b8f17170695330034683 Reviewed-on: https://go-review.googlesource.com/c/go/+/505795 TryBot-Bypass: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Sameer Ajmani <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent a031f4e commit f5015b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/go1.21.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
473473
The new <a href="/pkg/context/#AfterFunc"><code>AfterFunc</code></a>
474474
function registers a function to run after a context has been cancelled.
475475
</p>
476+
477+
<p><!-- CL 455455 -->
478+
An optimization means that the results of calling
479+
<a href="/pkg/context/#Background"><code>Background</code></a>
480+
and <a href="/pkg/context/#TODO"><code>TODO</code></a> and
481+
converting them to a shared type can be considered equal.
482+
In previous releases they were always different. Comparing
483+
<a href="/pkg/context/#Context"><code>Context</code></a> values
484+
for equality has never been well-defined, so this is not
485+
considered to be an incompatible change.
476486
</dd>
477487
</dl>
478488

0 commit comments

Comments
 (0)