-
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: add check for Context.WithValue(_, string, _) #17293
Labels
Milestone
Comments
I'd be happy to give this a try. |
Thanks. |
Submitted an initial CL here: https://go-review.googlesource.com/c/30084/. I suspect there's probably more I can do, but I would appreciate some review before I pursue this issue further. |
This is not a correctness issue and so should not be fixed in vet. It's a better candidate for lint. |
CL https://golang.org/cl/30084 mentions this issue. |
This was referenced Sep 30, 2016
Merged as golang/lint@c6242af |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Using a context.Context Value key of type
string
is a terrible idea and walks into the minefield of a global namespace. We should've outlawed it from day 1.All context value keys should be made from user-defined types.
Also disallow int, bool, etc. But string is what I usually see.
The text was updated successfully, but these errors were encountered: