Skip to content

Use Go version defined in go.mod for running Go linter action #998

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

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

jjngx
Copy link
Contributor

@jjngx jjngx commented Mar 4, 2025

Proposed changes

Use explicit Go version (defined in the go.mod file) to run Go linter workflow (GitHub Action - ActionLint). This way we will avoid current dependency issues on Go 1.24.

PR fixes this deps:

run golangci-lint
  Running [/home/runner/golangci-lint-1.63.4-linux-amd64/golangci-lint run] in [/home/runner/work/nginx-prometheus-exporter/nginx-prometheus-exporter] ...
  Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/vgetrandom_linux.go:7:9: file requires newer Go version go1.24 (application built with go1.23) (typecheck)
  package unix
          ^
  Error: ../../../go/pkg/mod/golang.org/x/[email protected]/http2/config_go124.go:7:9: file requires newer Go version go1.24 (application built with go1.23) (typecheck)
  package http2
          ^
  
  Error: issues found
  Ran golangci-lint in 23318ms

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING guide
  • I have proven my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have ensured the README is up to date
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch on my own fork

@github-actions github-actions bot added the chore Pull requests for routine tasks label Mar 4, 2025
@jjngx jjngx changed the title WIP - checking Go version Use explicit Go v1.23.6 for running Go linter action. Mar 4, 2025
@jjngx jjngx marked this pull request as ready for review March 4, 2025 14:44
@jjngx jjngx requested a review from a team as a code owner March 4, 2025 14:44
@jjngx jjngx changed the title Use explicit Go v1.23.6 for running Go linter action. Use Go version defined in go.mod for running Go linter action Mar 4, 2025
@jjngx jjngx self-assigned this Mar 4, 2025
@jjngx jjngx merged commit 158b78a into main Mar 4, 2025
15 checks passed
@jjngx jjngx deleted the chore/linter-fix branch March 4, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants