Skip to content
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

Running golangci-lint reports multiple issues #65

Closed
barchw opened this issue Oct 31, 2022 · 2 comments
Closed

Running golangci-lint reports multiple issues #65

barchw opened this issue Oct 31, 2022 · 2 comments

Comments

@barchw
Copy link
Contributor

barchw commented Oct 31, 2022

Description

Running golangci-lint in api-gateway results in reporting of the following violations

Report
Error return value is not checked

internal/processing/processing_test.go:1037:29
				rulev1alpha1.AddToScheme(scheme)
Error return value is not checked

internal/processing/processing_test.go:1038:34
				networkingv1beta1.AddToScheme(scheme)
Error return value is not checked

internal/processing/processing_test.go:1039:31
				gatewayv1beta1.AddToScheme(scheme)
Error return value of `c.Delete` is not checked

controllers/api_controller_integration_test.go:93:18
			defer c.Delete(context.TODO(), instance)
Error return value of `c.Delete` is not checked

controllers/api_controller_integration_test.go:158:18
			defer c.Delete(context.TODO(), instance)
Error return value of `c.Delete` is not checked

controllers/api_controller_integration_test.go:197:21
						defer c.Delete(context.TODO(), instance)
func `(*oauth).Validate` is unused

internal/validation/oauth.go:11:17
func (o *oauth) Validate(api *gatewayv1beta1.APIRule) error {
type `allow` is unused

internal/validation/allow.go:9:6
type allow struct{}
type `oauth` is unused

internal/validation/oauth.go:9:6
type oauth struct{}
func `(*allow).Validate` is unused

internal/validation/allow.go:11:17
func (a *allow) Validate(api *gatewayv1beta1.APIRule) error {
SA1019: "io/ioutil" has been deprecated since Go 1.16: 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.

internal/helpers/config.go:4:2
	"io/ioutil"
SA1019: fake.NewFakeClientWithScheme is deprecated: Please use NewClientBuilder instead.

controllers/api_controller_test.go:149:23
		mgr: getFakeManager(fake.NewFakeClientWithScheme(scheme.Scheme, objects...), scheme.Scheme),
SA1019: "io/ioutil" has been deprecated since Go 1.16: 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.

controllers/api_controller_test.go:7:2
	"io/ioutil"
SA9003: empty branch
internal/processing/processing.go:67:11
			} else if config.JWTHandler == helpers.JWT_HANDLER_ISTIO {
SA9003: empty branch
internal/processing/processing.go:78:9
	} else if config.JWTHandler == helpers.JWT_HANDLER_ISTIO {

Expected result
No violation is reported

@kyma-bot
Copy link
Contributor

This issue or PR has been automatically marked as stale due to the lack of recent activity.
Thank you for your contributions.

This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied
  • After 7d of inactivity since lifecycle/stale was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Close this issue or PR with /close

If you think that I work incorrectly, kindly raise an issue with the problem.

/lifecycle stale

@barchw
Copy link
Contributor Author

barchw commented Jan 4, 2023

Running golangci-lint ./... reports no issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants