-
Notifications
You must be signed in to change notification settings - Fork 18k
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
cmd/vet: warn when return value of context.WithValue is lost #41149
Comments
/cc @alandonovan per owners. It may be relevant that according to this tweet and issue dominikh/go-tools#819, this check is planned to be added to staticcheck. Also /cc @davecheney @Sajmani @dominikh FYI. |
Add context.WithValue to this list? |
Thanks @alandonovan, I've filed a PR here: golang/tools#248 🙂 |
Change https://golang.org/cl/252057 mentions this issue: |
The x/tools commit will need to be vendored into the main repository so that Reopening for that. |
Change https://golang.org/cl/252941 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?Not Applicable, but anyway...
go env
What did you do?
https://play.golang.org/p/NY8BWaciqad
What did you expect to see?
An error indicating that line 9 has a bug; that is,
WithContext
returns a new context but is not returned. Perhaps something like:What did you see instead?
When I run
go vet
on this code, I don't get any errors.The text was updated successfully, but these errors were encountered: