Skip to content
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

False Negative: return http.Request from closure #2

Open
sonatard opened this issue Jun 6, 2020 · 0 comments
Open

False Negative: return http.Request from closure #2

sonatard opened this issue Jun 6, 2020 · 0 comments

Comments

@sonatard
Copy link
Owner

sonatard commented Jun 6, 2020

req, _ := http.NewRequest(http.MethodPost, url, nil)       // want `should rewrite http.NewRequestWithContext or add \(\*Request\).WithContext`
_, _ = func() (*http.Request, error) { return req, nil }() // OK
cli.Do(req)
=== RUN   Test
--- FAIL: Test (0.63s)
    analysistest.go:324: a/a.go:33: no diagnostic was reported matching "should rewrite http.NewRequestWithContext or add \\(\\*Request\\).WithContext"
FAIL

Process finished with exit code 1
@sonatard sonatard changed the title Flase Negative: return http.Request from closure False Negative: return http.Request from closure Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant