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
Feature/deal with swtch stmt #2
Feature/deal with swtch stmt #2
Conversation
passes/erreq/erreq.go
Outdated
@@ -50,7 +70,56 @@ func run(pass *analysis.Pass) (interface{}, error) { | |||
return | |||
} | |||
|
|||
pass.Reportf(node.Pos(), "do not compare error with \"==\" or \"!=\"") |
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.
Tests didn't pass in my local environment maybe because the format of the report.
passes/erreq/erreq.go
Outdated
var causeFuncs = []string{ | ||
"TestCauseFunc", // For test | ||
|
||
"github.com/pkg/errors.Cause", |
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 want to focus on xerrors only, in this project.
So please remove this one.
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.
done
passes/erreq/erreq.go
Outdated
var errType = types.Universe.Lookup("error").Type().Underlying().(*types.Interface) | ||
|
||
var causeFuncs = []string{ | ||
"TestCauseFunc", // For test |
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.
We can test with xerrors.Unwrap
.
So please remove this one.
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.
done
fix #1