-
Notifications
You must be signed in to change notification settings - Fork 48
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
🌱 Enable all errorlint checks #839
base: main
Are you sure you want to change the base?
Conversation
@@ -66,7 +67,8 @@ func GetStorageClassesForPolicy( | |||
namespace, | |||
o.Name) | |||
if err != nil { | |||
if _, ok := err.(NotFoundInNamespace); !ok { | |||
var notFoundInNamespace NotFoundInNamespace | |||
if !errors.As(err, ¬FoundInNamespace) { |
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.
Out of curiosity, can we not use https://pkg.go.dev/errors#Is here?
And another place, you have used fault.As
for a similar check.
@@ -102,6 +103,8 @@ func ContainsError(err error, message string) bool { | |||
return true | |||
} | |||
} | |||
default: |
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.
Out of curiosity, why did you have to add the nolint and why this default block?
Use %w instead of %v to wrap errors Use errors Is() and As() and the govmomi fault equivalents instead of type casting/checking
74c81d7
to
d492353
Compare
Minimum allowed line rate is |
What does this PR do, and why is it needed?
Use %w instead of %v to wrap errors
Use errors Is() and As() and the govmomi equivalents instead of type casting/checking
Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Are there any special notes for your reviewer:
Please add a release note if necessary: