-
Notifications
You must be signed in to change notification settings - Fork 34
feat: add option for reporting internal errors #60
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
feat: add option for reporting internal errors #60
Conversation
|
Thanks a lot for the PR! I will have a look in more detail shortly, but looks good from a quick glance. |
wrapcheck/wrapcheck.go
Outdated
| fnIdent, ok := call.Fun.(*ast.Ident) | ||
| if ok { | ||
| fnSig := pass.TypesInfo.ObjectOf(fnIdent).String() | ||
| pass.Reportf(tokenPos, "error should be unwrapped: sig: %s", fnSig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the error message here should be more along the lines of error should be wrapped as the purpose of this is to identify incorrectly unwrapped errors.
| pass.Reportf(tokenPos, "error should be unwrapped: sig: %s", fnSig) | |
| pass.Reportf(tokenPos, "package-internal error should be wrapped: sig: %s", fnSig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comment.
I have fixed the error messages.
tomarrell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of questions, thanks a lot! 😃
067f50b to
e13f4da
Compare
tomarrell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks a lot! Will soon cut a new release for these changes.
Cheers!
Added the
ReportInternalErrorsoption to report internal errors.close #59