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 positive when close is in another package #39

Open
vasyharan opened this issue Mar 27, 2022 · 1 comment
Open

false positive when close is in another package #39

vasyharan opened this issue Mar 27, 2022 · 1 comment

Comments

@vasyharan
Copy link

The following code triggers a false positive.

package util

import (
	"io"
	"log"
)

func Close(c io.Closer) {
	if err := c.Close(); err != nil {
		log.Printf("error closing io: %w", err)
	}
}
package main

import (
	"net/http"
	"util"
)

func main() {
	res, _ := http.Get("http://example.com/")
	defer util.Close(res.Body)
}
@kainobor
Copy link

Is there any progress on this issue?

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

2 participants