-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
replace golint with revive linter #13973
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
LGTM
In case you need to rebase/repush, consider using fmt.Errorf
instead of errors.Wrap{f}
.
@@ -28,7 +27,7 @@ func Archive(w http.ResponseWriter, r *http.Request) { | |||
case http.MethodHead, http.MethodGet: | |||
handleHeadAndGet(w, r, decoder, runtime) | |||
default: | |||
utils.Error(w, http.StatusNotImplemented, errors.New(fmt.Sprintf("unsupported method: %v", r.Method))) | |||
utils.Error(w, http.StatusNotImplemented, errors.Errorf("unsupported method: %v", r.Method)) |
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.
utils.Error(w, http.StatusNotImplemented, errors.Errorf("unsupported method: %v", r.Method)) | |
utils.Error(w, http.StatusNotImplemented, fmt.Errorf("unsupported method: %v", r.Method)) |
@@ -49,7 +49,7 @@ type InMemoryManager struct { | |||
// of locks. | |||
func NewInMemoryManager(numLocks uint32) (Manager, error) { | |||
if numLocks == 0 { | |||
return nil, errors.Errorf("must provide a non-zero number of locks!") | |||
return nil, errors.Errorf("must provide a non-zero number of locks") |
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.
return nil, errors.Errorf("must provide a non-zero number of locks") | |
return nil, fmt.Errorf("must provide a non-zero number of locks") |
@@ -264,7 +264,7 @@ func (c *Container) handleRestartPolicy(ctx context.Context) (_ bool, retErr err | |||
if c.ensureState(define.ContainerStateRunning, define.ContainerStatePaused) { | |||
return false, nil | |||
} else if c.state.State == define.ContainerStateUnknown { | |||
return false, errors.Wrapf(define.ErrInternal, "invalid container state encountered in restart attempt!") | |||
return false, errors.Wrapf(define.ErrInternal, "invalid container state encountered in restart attempt") |
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.
return false, errors.Wrapf(define.ErrInternal, "invalid container state encountered in restart attempt") | |
return false, fmt.Errorf("invalid container state encountered in restart attempt: %w", define.ErrInternal) |
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.
Yes lets do this as a global change separate from this PR.
@vrothberg I would prefer to make such changes in a different commit/PR. |
golint, scopelint and interfacer are deprecated. golint is replaced by revive. This linter is better because it will also check for our error style: `error strings should not be capitalized or end with punctuation or a newline` scopelint is replaced by exportloopref (already endabled) interfacer has no replacement but I do not think this linter is important. Signed-off-by: Paul Holzinger <[email protected]>
LGTM |
/lgtm |
LGTM |
/hold cancel |
golint, scopelint and interfacer are deprecated. golint is replaced by
revive. This linter is better because it will also check for our error
style:
error strings should not be capitalized or end with punctuation or a newline
scopelint is replaced by exportloopref (already endabled)
interfacer has no replacement but I do not think this linter is
important.