-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing: B.Context returns nil context #70866
Labels
Milestone
Comments
Related Issues
Related Code Changes (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Change https://go.dev/cl/637236 mentions this issue: |
I've sent a CL to fix this. On that CL I've raised the issue that #36532 only accepted |
wyf9661
pushed a commit
to wyf9661/go
that referenced
this issue
Jan 21, 2025
CL 603959 added T.Context for golang#36532. The discussion on the proposal only mentions t.Context. However, the implementation of CL 603959 also added B.Context and F.Context. They were added to the API listing, and B.Context was mentioned in the release notes. Unfortunately, the new B.Context and F.Context methods always returned nil, rather than a context.Context value. This change adds a working implementation of B.Context and F.Context. For golang#36532 Fixes golang#70866 Change-Id: I8a44e6649fb658e4f641ffb7efd08b4374f578ef Reviewed-on: https://go-review.googlesource.com/c/go/+/637236 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: David Chase <[email protected]> Reviewed-by: Damien Neil <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go version
go version go1.24rc1 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
https://go.dev/play/p/A-SjUqygxkd?v=gotip
Tried to use testing.T.Context and testing.B.Context
What did you see happen?
testing.T.Context returns non-nil context (as expected), but testing.B.Context returns nil context
What did you expect to see?
Both t.Context() and b.Context() returning a non-nil context
The text was updated successfully, but these errors were encountered: