-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix linting errors: ```sh $ golangci-lint run ./... WARN [linters context] structcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the golangci/golangci-lint#2649. pkg/spec/spec.go:30:2: SA1019: package io/ioutil is deprecated: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck) "io/ioutil" ^ pkg/spec/extension.go:139:5: SA4006: this value of `item` is never used (staticcheck) item := &openapi3.PathItem{} ^ cmd/manager/main.go:366:11: Error return value of `c.AddFunc` is not checked (errcheck) c.AddFunc("@daily", func() { ^ internal/envoy/config/hcm_test.go:34:2: SA1019: package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead. (staticcheck) "github.com/golang/protobuf/proto" ^ smoketests/basic/basic_test.go:20:2: `defaultName` is unused (deadcode) defaultName = "default" ^ cmd/kusk/internal/mocking/server/server.go:61:9: Error return value of `io.Copy` is not checked (errcheck) io.Copy(io.Discard, reader) ^ cmd/kusk/internal/overlays/overlays.go:138:9: Error return value of `io.Copy` is not checked (errcheck) io.Copy(io.Discard, reader) ^ smoketests/common/commonSuite.go:36:20: Error return value is not checked (errcheck) kuskv1.AddToScheme(scheme) ^ smoketests/common/commonSuite.go:37:20: Error return value is not checked (errcheck) corev1.AddToScheme(scheme) ^ smoketests/common/commonSuite.go:38:18: Error return value is not checked (errcheck) apps.AddToScheme(scheme) ^ api/v1alpha1/webhook_suite_test.go:55:5: `cfg` is unused (deadcode) var cfg *rest.Config ^ api/v1alpha1/envoyfleet_webhook.go:49:2: SA9004: only the first constant in this group has an explicit type (staticcheck) EnvoyFleetMutatingWebhookPath string = "/mutate-gateway-kusk-io-v1alpha1-envoyfleet" ^ internal/envoy/auth/parser.go:95:3: S1021: should merge variable declaration with assignment on next line (gosimple) var err error ^ smoketests/basic_auth/basic_auth_test.go:47:2: `testPort` is unused (deadcode) testPort = 82 ^ smoketests/mocking/mocking_test.go:26:2: `testPort` is unused (deadcode) testPort = 82 ^ internal/validation/const.go:41:2: `reAdjustSubstitutions` is unused (deadcode) reAdjustSubstitutions = regexp.MustCompile(`\\(\d+)`) ^ internal/validation/extension.go:9:2: SA1019: package io/ioutil is deprecated: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck) "io/ioutil" ^ internal/webhooks/certs.go:244:31: S1019: should use make([]string, count) instead (gosimple) operations := make([]string, count, count) ^ cmd/kusk/cmd/root.go:94:2: `cmdGroupCommands` is unused (deadcode) cmdGroupCommands = "2-Commands" ^ cmd/kusk/cmd/version_test.go:34:6: `test_NewVersionCommand` is unused (deadcode) func test_NewVersionCommand(t *testing.T) { ^ cmd/kusk/cmd/add_gateway.go:244:8: Error return value of `c.List` is not checked (errcheck) c.List(context.Background(), &services, &client.ListOptions{}) ^ cmd/kusk/cmd/dashboard.go:159:18: Error return value of `process.Execute` is not checked (errcheck) process.Execute(browserOpenCMD, browserOpenArgs...) ^ cmd/kusk/cmd/install.go:329:15: Error return value of `os.MkdirAll` is not checked (errcheck) os.MkdirAll(filePath, os.ModePerm) ^ cmd/kusk/cmd/mock.go:459:26: Error return value of `mockCmd.MarkFlagRequired` is not checked (errcheck) mockCmd.MarkFlagRequired("in") ^ cmd/kusk/cmd/root.go:63:33: Error return value of `analytics.SendAnonymousCMDInfo` is not checked (errcheck) analytics.SendAnonymousCMDInfo(nil) ^ cmd/kusk/cmd/validate.go:63:30: Error return value of `validateCmd.MarkFlagRequired` is not checked (errcheck) validateCmd.MarkFlagRequired("file") ^ cmd/kusk/cmd/root.go:125:9: S1005: unnecessary assignment to the blank identifier (gosimple) for k, _ := range groups { ^ cmd/kusk/cmd/deploy.go:208:2: SA4006: this value of `parsedApiSpec` is never used (staticcheck) parsedApiSpec := &openapi3.T{} ^ cmd/kusk/cmd/mock.go:117:4: SA4006: this value of `err` is never used (staticcheck) popFunc, err := pushDirectory(filepath.Dir(absoluteApiSpecPath)) ^ internal/controllers/envoyfleet_resources.go:43:2: `kuskGatewayManagerImageName` is unused (deadcode) kuskGatewayManagerImageName = "kusk-gateway" ^ internal/controllers/parser.go:742:6: `generateMockID` is unused (deadcode) func generateMockID(path string, method string, operationID string) string { ^ internal/controllers/suite_test.go:49:5: `cfg` is unused (deadcode) var cfg *rest.Config ^ internal/controllers/parser.go:424:126: S1002: should omit comparison to bool constant, can be simplified to `!*finalOpts.Validation.Request.Enabled` (gosimple) if finalOpts.Validation == nil || finalOpts.Validation.Request == nil || finalOpts.Validation.Request.Enabled == nil || *finalOpts.Validation.Request.Enabled == false { ``` --- Signed-off-by: Mohamed Bana <[email protected]> * address PR comments and fix linting issues that appeared after merging main * address PR comments and fix linting issues that appeared after merging main * attempt to fix test version command test * add golangci lint pipeline * add golangci lint pipeline * add timeout to golangci lint pipeline * remove commented out action params Signed-off-by: Mohamed Bana <[email protected]> Co-authored-by: Kyle Hodgetts <[email protected]>
- Loading branch information
Showing
34 changed files
with
143 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
permissions: | ||
contents: read | ||
# allow read access to pull request. Use with `only-new-issues` option. | ||
pull-requests: read | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
args: --timeout=10m0s | ||
only-new-issues: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.