noctx
noctx copied to clipboard
False Negative: return http.Request from closure
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