Skip to content

Upgrade Go to 1.27.3 - #372

Merged
baiyuqing merged 3 commits into
mainfrom
upgrade-go-1.27.3
Oct 26, 2026
Merged

baiyuqing merged 3 commits into
mainfrom
upgrade-go-1.27.3

Conversation

@baiyuqing

@baiyuqing baiyuqing commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Set the go directive in the root go.mod from 1.24.0 to 1.27.3 to fix CVE-2026-111943.

The lint, test, and release workflows use actions/setup-go@v5 with go-version-file: './go.mod', so they build with Go 1.27.3 after this change.

pkg/go.mod stays at go 1.24. The root module references it through replace => ./pkg, so the CLI binary's toolchain is set by the root go.mod. Raising pkg/go.mod would require every downstream consumer of pkg to use Go 1.27.3.

Verification

With go1.27.3:

  • go mod tidy: no changes to go.mod or go.sum beyond the go line
  • go build ./... and go vet ./... pass
  • go test ./... passes for all packages except ./scripts, which was not run successfully locally: the sandbox blocked mktemp under /var/folders. It passes in CI on ubuntu, macos, and windows.

golangci-lint upgrade

golangci-lint v1.64.7 is built with go1.24 and fails with the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.27.3). A v1.64.8 binary built locally with go1.27.3 reports 50 false typecheck errors, because v1 cannot load Go 1.27 packages. This PR therefore also:

  • upgrades golangci-lint-action v6 -> v9 and golangci-lint v1.64.7 -> v2.15.0 (the official binary is built with go1.27.0, which passes the version check)
  • converts .golangci.yml to the v2 format with golangci-lint migrate, then re-adds run.timeout: 10m, which the tool drops (the v2 default of 0 disables the timeout)
  • adds //nolint:gosec for G703 on os.WriteFile("install.sh", ...) in cmd/manifest/update_latest_version.go, where the path is a string constant

Locally, golangci-lint config verify passes and golangci-lint run ./... reports 0 issues.

Set the go directive in go.mod to 1.27.3 to fix CVE-2026-111943. CI and
release workflows read the Go version from go.mod via setup-go
go-version-file, so they build with 1.27.3 after this change.
@ti-chi-bot ti-chi-bot Bot added the size/XS label Oct 26, 2026
golangci-lint v1.64.7 is built with go1.24 and refuses to run when
go.mod targets go 1.27.3. A v1.64.8 binary built with go1.27.3 reports
50 false typecheck errors because v1 cannot load Go 1.27 packages.

- golangci-lint-action v6 -> v9, golangci-lint v1.64.7 -> v2.15.0
- Convert .golangci.yml to the v2 format with `golangci-lint migrate`
- Suppress gosec G703 on the os.WriteFile call in
  cmd/manifest/update_latest_version.go: the path is a string constant
@ti-chi-bot ti-chi-bot Bot added size/L and removed size/XS labels Oct 26, 2026
golangci-lint migrate drops run.timeout, and in v2 the default of 0
disables the timeout. Re-add the previous 10m value.
@baiyuqing
baiyuqing merged commit 547e25c into main Oct 26, 2026
7 checks passed
@baiyuqing
baiyuqing deleted the upgrade-go-1.27.3 branch October 26, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants