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

Support for Wrapping Errors with defer #17

Open
qawatake opened this issue Jun 9, 2024 · 0 comments
Open

Support for Wrapping Errors with defer #17

qawatake opened this issue Jun 9, 2024 · 0 comments

Comments

@qawatake
Copy link

qawatake commented Jun 9, 2024

It would be great if the tool could also check cases where errors are wrapped using defer, such as with golang.org/x/pkgsite/internal/derrors.Wrap.

func wrap(errp *error) {}

func f() (err error) {
	defer wrap(&err)
	err = do()
	if err != nil {
		return nil // want "error is not nil"
	}
	return nil
}

Would it be possible to add support for this scenario?

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