]> Cypherpunks repositories - gostls13.git/commit
context: don't return a nil Cause for a canceled custom context
authorDamien Neil <dneil@google.com>
Tue, 8 Apr 2025 20:39:08 +0000 (13:39 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 8 Apr 2025 21:04:56 +0000 (14:04 -0700)
commitec4a9fb3211e1b7bd4035af7d70f17a21cd26508
treebb1ff997a7e9d98bf540166d99fd11aa3c209c26
parent3acd4402195aadc581aa68977154ac3b3403f8af
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>
src/context/context.go
src/context/x_test.go