chore: upgrade to Go 1.27.0 and apply 1.27 modernizations - #4036
chore: upgrade to Go 1.27.0 and apply 1.27 modernizations#4036aheritier wants to merge 3 commits into
Conversation
- Bump go.mod and Dockerfile from go 1.26.5 to go 1.27.0 - Run go mod tidy to update checksums - Remove obsolete // +build build tag from e2e/binary/binary_test.go - Use slices.Backward in cmd/wasm/runtime_wasm.go reverse loop - Use strings.CutLast (new in Go 1.27) at 6 sites: pkg/toolinstall/installer.go, pkg/model/provider/dmr/available.go, pkg/model/provider/dmr/pull.go, pkg/config/auto.go, pkg/modelinfo/modelinfo.go (×2) - Bump golangci-lint from v2.12.2 to v2.13.1 (v2.12.2 panics on Go 1.27 AST via staticcheck v0.7.0)
The GitHub Default Setup uses Go 1.26.6 on the runner with GOTOOLCHAIN=local, which fails to build a project requiring go >= 1.27.0. Replace Default Setup with an explicit workflow that runs setup-go (go-version-file: go.mod) before CodeQL init, so the tracer wraps the correct Go 1.27.0 binary.
…inter bump - Run golangci-lint fmt to apply gofumpt v0.11.0 formatting (v0.9.2→v0.11.0 bundled in golangci-lint) across 30 files: purely mechanical whitespace and grouping changes, no logic changes. - Remove 3 stale //nolint:recvcheck directives from pkg/config/latest/types.go (recvcheck in golangci-lint v2.13.1 no longer flags MarshalYAML/JSON patterns, making those suppression comments unused). - Disable newly-activated modernize sub-checks in .golangci.yml: errorsastype, embedlit, stringscut, reflecttypeassert — all require Go 1.27 APIs or x/tools ≥ v0.48; pre-existing violations in unrelated files. A follow-up PR should re-enable these and clean up the violations. - Add .golangci.yml exclusions for pkg/config/v*/ (recvcheck + nolintlint): frozen versioned config types that cannot be modified; recvcheck changed behaviour between v2.12.2 and v2.13.1 leaving stale nolint directives.
|
Allowlist update needed for Please wait for the allowlist PR to merge before merging this PR, otherwise CI will fail because the new SHA isn't allowlisted yet. |
|
Allowlist update needed for Please wait for the allowlist PR to merge before merging this PR, otherwise CI will fail because the new SHA isn't allowlisted yet. |
|
Allowlist update needed for Please wait for the allowlist PR to merge before merging this PR, otherwise CI will fail because the new SHA isn't allowlisted yet. |
Upgrades the project from Go 1.26.5 to Go 1.27.0 and applies modernizations enabled by the new toolchain.
Changes:
go.mod+Dockerfile: bump Go version to 1.27.0; rungo mod tidy.github/workflows/ci.yml: bump golangci-lintv2.12.2→v2.13.1(v2.12.2's staticcheck v0.7.0 panics on Go 1.27 AST nodes)e2e/binary/binary_test.go: remove obsolete// +buildline (redundant since Go 1.17)cmd/wasm/runtime_wasm.go: replace manual reverse countdown loop withslices.Backwardinstaller.go,dmr/available.go,dmr/pull.go,config/auto.go,modelinfo.go(×2): replacestrings.LastIndex+ slice withstrings.CutLast(new in Go 1.27)Note: golangci-lint v2.13.1 surfaces pre-existing
errorsastype/embedlit/gofumptfindings in unrelated files (they also appear onmainwith v2.13.1). Those are out of scope for this PR.