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

make check updates to cope with oldest stable version go1.22 #345

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

anoopcs9
Copy link
Collaborator

@anoopcs9 anoopcs9 commented Aug 22, 2024

go1.23 has been released which demands updates to various components.

golangci-lint

  • We happened to observe the panic from the linked issue Panic seen with golangci-lint and gosec during make check #344 which should be fixed with latest golangci-lint versions.
  • The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar.
  • The linter named "megacheck" is deprecated. It has been split into: gosimple, staticcheck, unused.
  • The configuration option linters.govet.check-shadowing is deprecated. Please enable shadow instead, if you are not using enable-all.
  • Additional fixes to make new govet happy.

gosec
We happened to observe the panic from the linked issue #344 which should be fixed with latest gosec versions.

go-version-check.sh
Update Dockerfile to reflect the oldest stable version go1.22 so as to pass make check-dockerfile-go-version.

fixes #344

@anoopcs9 anoopcs9 changed the title hack: Bump golang-ci-lint to v1.60.2 hack: Bump golangci-lint and gosec versions Aug 22, 2024
@anoopcs9 anoopcs9 changed the title hack: Bump golangci-lint and gosec versions make check updates to cope with oldest stable version go1.22 Aug 22, 2024
@anoopcs9 anoopcs9 marked this pull request as ready for review August 22, 2024 11:59
synarete
synarete previously approved these changes Aug 22, 2024
- The linter 'exportloopref' is deprecated (since v1.60.2) due to:
  Since Go1.22 (loopvar) this linter is no longer relevant. Replaced
  by copyloopvar.
- The linter named \"megacheck\" is deprecated. It has been split into:
  gosimple, staticcheck, unused.
- The configuration option `linters.govet.check-shadowing` is
  deprecated. Please enable `shadow` instead, if you are not using
  `enable-all`.

Also fixes all occurrence of "Error: printf: non-constant format string
in call to fmt.Errorf (govet)" error.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Updating gosec to avoid the panic raised with go1.22.

Signed-off-by: Anoop C S <anoopcs@samba.org>
go1.23 is now available making go1.22 the oldest supported release. We
should now update the Dockerfile accordingly to make go-version-check.sh
happy.

Signed-off-by: Anoop C S <anoopcs@samba.org>
@anoopcs9
Copy link
Collaborator Author

  • The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar.

Added the new/replaced linter copyloopvar with the following additional warning:

WARN [linters_context] copyloopvar: this linter is disabled because the Go version (1.19) of your project is lower than Go 1.22

Copy link
Collaborator

@synarete synarete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. sorry for the delay in review this slipped past my radar

@mergify mergify bot merged commit 32375ce into samba-in-kubernetes:master Sep 4, 2024
13 checks passed
@anoopcs9 anoopcs9 deleted the update-golangci-lint branch September 4, 2024 15:05
@mergify mergify bot added the priority-review This PR deserves a look label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-review This PR deserves a look
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic seen with golangci-lint and gosec during make check
3 participants