-
Notifications
You must be signed in to change notification settings - Fork 18k
context: WithValue documentation should discourage use of basic types #17302
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
Comments
Yes, please! |
I'll submit a CL shortly. |
It appears I was incorrect: https://golang.org/pkg/context/#Context
Should this be reiterated in the documentation for |
More warnings SGTM. |
CL submitted: https://go-review.googlesource.com/c/30134/. Happy to re-phrase as needed. |
CL https://golang.org/cl/30134 mentions this issue. |
CL https://golang.org/cl/33152 mentions this issue. |
Fixes #17826 Updates #17302 Change-Id: I7c1ebd965e679e7169a97e62d27ae3ede2473aa1 Reviewed-on: https://go-review.googlesource.com/33152 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Related to: #17293.
I've submitted a fix to
golint
to begin warning about this, but I also feel that it would be a good idea to explicitly document that only user-defined types should be used as keys incontext.WithValue
.As of now, there is no such warning. The only advice given is:
EDIT: I was incorrect, see: #17302 (comment).
CC @bradfitz @alandonovan
The text was updated successfully, but these errors were encountered: