go/src/context
Damien Neil ec4a9fb321 context: don't return a nil Cause for a canceled custom context
Avoid a case where Cause(ctx) could return nil for a canceled context,
when ctx is a custom context implementation and descends from a
cancellable-but-not-canceled first-party Context.

Fixes #73258

Change-Id: Idbd81ccddea82ecabece4373d718baae6ca4b58e
Reviewed-on: https://go-review.googlesource.com/c/go/+/663936
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-08 14:04:56 -07:00
..
afterfunc_test.go context: replace newAfterFuncContext with a global declaration using blank identifier 2025-02-20 08:16:29 -08:00
benchmark_test.go context: use atomic operation in ctx.Err 2025-03-03 12:32:57 -08:00
context.go context: don't return a nil Cause for a canceled custom context 2025-04-08 14:04:56 -07:00
context_test.go context: add AfterFunc 2023-04-19 19:13:01 +00:00
example_test.go context: use "canceled" in docs to refer to timed-out contexts 2025-01-03 14:30:13 -08:00
net_test.go
x_test.go context: don't return a nil Cause for a canceled custom context 2025-04-08 14:04:56 -07:00