-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
chore: enable unnecessary-stmt from revive #21398
chore: enable unnecessary-stmt from revive #21398
Conversation
Signed-off-by: Matthieu MOREL <[email protected]>
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21398 +/- ##
==========================================
+ Coverage 55.16% 55.25% +0.08%
==========================================
Files 337 337
Lines 57039 57034 -5
==========================================
+ Hits 31464 31512 +48
+ Misses 22874 22825 -49
+ Partials 2701 2697 -4 ☔ View full report in Codecov by Sentry. |
} | ||
if issuedAtTime, err := jwtutil.IssuedAtTime(claims); err == nil { | ||
rvalsStrs = append(rvalsStrs, "iat: "+issuedAtTime.Format(time.RFC3339)) | ||
if err == nil { |
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.
if err == nil { | |
if err == nil { |
we should also check for the case when err is non-nil
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.
What do you suggest here ?
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 change is fine, although it reads a little weird. Looks functionally identical to before.
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.
PTAL.
Description
unnecessary-stmt: This rule suggests to remove redundant statements like a break at the end of a case block, for improving the code's readability.