Fix golangci-lint errors#1068
Conversation
knative-prow-robot
left a comment
There was a problem hiding this comment.
@daisy-ycguo: 0 warnings.
Details
In response to this:
Description
The output of golangci-lint includes below errors:
$ golangci-lint run --out-format=github-actions ::error file=pkg/kn/commands/channel/list_types_test.go,line=156,col=2::ineffectual assignment to `output` (ineffassign) ::error file=pkg/kn/commands/channel/list_types_test.go,line=167,col=2::ineffectual assignment to `output` (ineffassign) ::error file=pkg/kn/commands/channel/list_types_test.go,line=181,col=2::ineffectual assignment to `output` (ineffassign) ::error file=pkg/kn/commands/subscription/flags.go,line=113,col=2::Consider preallocating `others` (prealloc) ::error file=pkg/messaging/v1beta1/subscriptions_client_mock.go,line=30,col=2::`namespace` is unused (structcheck) ::error file=pkg/dynamic/client_test.go,line=346,col=9::composites: `k8s.io/apimachinery/pkg/runtime/schema.GroupVersion` composite literal uses unkeyed fields (govet) ::error file=pkg/dynamic/client_test.go,line=353,col=45::composites: `k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind` composite literal uses unkeyed fields (govet) ::error file=pkg/dynamic/client_test.go,line=360,col=45::composites: `k8s.io/apimachinery/pkg/runtime/schema.GroupVersionKind` composite literal uses unkeyed fields (govet) ::error file=pkg/kn/flags/channel_types.go,line=122,col=2::unreachable: unreachable code (govet) ::error file=pkg/dynamic/client_test.go,line=352,col=25::SA5011: possible nil pointer dereference (staticcheck) ::error file=pkg/dynamic/client_test.go,line=359,col=25::SA5011: possible nil pointer dereference (staticcheck) ::error file=pkg/kn/commands/channel/list_types_test.go,line=111,col=30::SA5011: possible nil pointer dereference (staticcheck)This will affect precheck of every PRs and will cause a
Code Style / Lint (pull_request) Failing after 55s — Lint.This PR is to fix those errors in order to pass the Lint check.
Changes
- Fixes Lint check errors
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
|
The following is the coverage report on the affected files.
|
|
@rhuss @maximilien This PR is to fix the link test failures: https://github.com/knative/client/pull/1024/checks?check_run_id=1258727196 . Please help to review. Thank you. |
navidshaikh
left a comment
There was a problem hiding this comment.
/lgtm
/approve
Thanks @daisy-ycguo !
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: daisy-ycguo, navidshaikh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
The output of golangci-lint includes below errors:
This will affect precheck of every PRs and will cause a
Code Style / Lint (pull_request) Failing after 55s — Lint.This PR is to fix those errors in order to pass the Lint check.
Changes