We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Go is frequently used for servers. And as such http.Handler is used often.
Given the following code;
package main import ( "context" "net/http" ) func foo(ctx context.Context, a, b int) {} func myHandler(w http.ResponseWriter, r *http.Request) { foo(context.Background(), 2, 33) } func main() {}
I think contextcheck should error with a message like; Non-inherited new context, use r.Context() instead
contextcheck
Non-inherited new context, use
instead
And to resolve the error, you would have to do:
foo(r.Context(), 2, 33)
The text was updated successfully, but these errors were encountered:
good idea 😊
Sorry, something went wrong.
Done in new version, golangci/golangci-lint#3102
No branches or pull requests
Go is frequently used for servers. And as such http.Handler is used often.
Given the following code;
I think
contextcheck
should error with a message like;Non-inherited new context, use
r.Context()instead
And to resolve the error, you would have to do:
The text was updated successfully, but these errors were encountered: