-
Notifications
You must be signed in to change notification settings - Fork 6
Update golangci-lint workflow to Go 1.24 #42
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
Update golangci-lint workflow to Go 1.24 #42
Conversation
Change go version from '1.24.0' to '1.24' to fix compatibility with Go 1.19 used in CI workflow. The three-part version format (1.24.0) is only supported in Go 1.21+, but the golangci-lint workflow uses Go 1.19.13 which requires the two-part format (1.24). Co-authored-by: migue <[email protected]>
The code requires Go 1.24 features, so the workflow needs to use Go 1.24 instead of Go 1.19. Also updated go.mod to include the toolchain directive which is standard for Go 1.21+. Co-authored-by: migue <[email protected]>
Co-authored-by: migue <[email protected]>
Co-authored-by: migue <[email protected]>
Co-authored-by: migue <[email protected]>
Co-authored-by: migue <[email protected]>
Fix golangci-lint failures in CI
…w-again Fix golangci-lint workflow for Go 1.24 compatibility
a8a0783
into
dependabot/go_modules/golang.org/x/sync-0.19.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the golangci-lint workflow to use Go 1.24, which is necessary because Go 1.19 cannot parse the three-part version format go 1.24.0 in go.mod. The PR also includes various linting fixes to comply with updated linter requirements.
Changes:
- Updated GitHub Actions workflow to use Go 1.24 and newer golangci-lint versions
- Added
toolchain go1.24.11directive togo.mod(standard for Go 1.21+) - Updated
.golangci.ymlconfiguration and fixed linting issues (unused parameters, loop variable captures)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/golangci-lint.yml |
Updated Go version to 1.24 and golangci-lint versions |
go.mod |
Added toolchain directive for Go 1.24.11 |
.golangci.yml |
Updated linter configuration to new format |
pipe/pipeline_test.go |
Fixed unused parameters and removed loop variable capture |
pipe/pipeline.go |
Fixed unused parameter and added nolint directive |
pipe/command_test.go |
Removed loop variable capture |
pipe/command.go |
Simplified ProcessState.Sys() call |
internal/ptree/ptree_test.go |
Fixed unused parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| version: "2" | ||
|
|
||
| linters-settings: | ||
| depguard: | ||
| rules: | ||
| main: | ||
| files: | ||
| - "$all" | ||
| - "!$test" | ||
| deny: | ||
| - pkg: io/ioutil | ||
| desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil | ||
| linters: | ||
| enable: | ||
| - copyloopvar | ||
| - depguard | ||
| - errcheck | ||
| - gocritic | ||
| - gocyclo | ||
| - gosec | ||
| - govet | ||
| - ineffassign | ||
| - misspell | ||
| - nakedret | ||
| - prealloc | ||
| - revive | ||
| - staticcheck | ||
| - unconvert | ||
| - unused | ||
| disable: | ||
| - gochecknoglobals # we allow global variables in packages | ||
| - gochecknoinits # we allow inits in packages | ||
| - goconst # we allow repeated values to go un-const'd | ||
| - lll # we allow any line length | ||
| - unparam # we allow function calls to name unused parameters | ||
| settings: | ||
| depguard: | ||
| rules: | ||
| main: | ||
| files: | ||
| - $all | ||
| - '!$test' | ||
| deny: | ||
| - pkg: io/ioutil | ||
| desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil | ||
| exclusions: | ||
| generated: lax | ||
| presets: | ||
| - comments | ||
| - common-false-positives | ||
| - legacy | ||
| - std-error-handling | ||
| paths: | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
| - internal/deprecated$ | ||
|
|
||
| run: | ||
| timeout: 5m | ||
| skip-dirs: | ||
| - internal/deprecated | ||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| - goimports | ||
| exclusions: | ||
| generated: lax | ||
| paths: | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The golangci-lint configuration format appears to be incorrect. The "version: 2" format is not a valid golangci-lint configuration version. The "formatters" section and the top-level "exclusions" section are not standard configuration keys in golangci-lint. Formatters like gofmt and goimports should be configured as linters in the "linters" section, and exclusions should be under "issues.exclude-rules" or similar. Please consult the golangci-lint documentation for the correct v1.x configuration format.
The golangci-lint workflow was failing because it used Go 1.19, which cannot parse the three-part version format
go 1.24.0ingo.mod. The codebase requires Go 1.24 language features.Changes
.github/workflows/golangci-lint.yml: Updatedgo-versionfrom1.19to1.24go.mod: Addedtoolchain go1.24.11directive viago mod tidy(standard for Go 1.21+)The three-part version format and toolchain directive are only supported in Go 1.21+, making the workflow version mismatch a breaking issue.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
go.googlesource.com/update-job-proxy /update-job-proxy DOCKER test sed -e ntrust_Root_Certification_Authority.pem -e est -e s/,/_/g deb4aaf96cae3708--global sed -e Trust_RSA_Root-0ssh://[email protected]/ -e /bin/test -e s/,/_/g deb4aaf96cae3708-t test(dns block)/update-job-proxy /update-job-proxy ACCEPT /bin/test test -e JCA_Global_Root_CA2.pem test /usr/bin/test 28a8a30.0 test "--bare test -e ity_ECC.pem e-handler(dns block)go.uber.org/update-job-proxy /update-job-proxy DOCKER test sed -e ntrust_Root_Certification_Authority.pem -e est -e s/,/_/g deb4aaf96cae3708--global sed -e Trust_RSA_Root-0ssh://[email protected]/ -e /bin/test -e s/,/_/g deb4aaf96cae3708-t test(dns block)/update-job-proxy /update-job-proxy ACCEPT /bin/test test -e JCA_Global_Root_CA2.pem test /usr/bin/test 28a8a30.0 test "--bare test -e ity_ECC.pem e-handler(dns block)gopkg.in/update-job-proxy /update-job-proxy DOCKER test sed -e ntrust_Root_Certification_Authority.pem -e est -e s/,/_/g deb4aaf96cae3708--global sed -e Trust_RSA_Root-0ssh://[email protected]/ -e /bin/test -e s/,/_/g deb4aaf96cae3708-t test(dns block)/update-job-proxy /update-job-proxy ACCEPT /bin/test test -e JCA_Global_Root_CA2.pem test /usr/bin/test 28a8a30.0 test "--bare test -e ity_ECC.pem e-handler(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.