-
Notifications
You must be signed in to change notification settings - Fork 33
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 Positive when http.Response from a function #42
Comments
I came here to report a similar example. With package main
import (
"fmt"
"io"
"net/http"
)
func id[T any](r T) T { return r }
func main() {
resp, err := http.Get("http://localhost:8008")
if err != nil {
panic(err)
}
resp = id(resp)
defer resp.Body.Close()
bs, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Printf("%s", bs)
} I find that go vet -vettool=$(which bodyclose) ./... prints out
(This is not sensitive to the use of generics.) |
1 task
I've just stumbled across this issue and it seems there's been a few other cases like this reported over the last year+ and no response from the author of the repo. Is it safe to presume this tool has been abandoned? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code triggers a false positive.
The text was updated successfully, but these errors were encountered: