Skip to content

build(go): upgrade Go toolchain to 1.26.3 + golangci-lint to v2.12.2#43

Merged
ninjadq merged 9 commits into
Azure:mainfrom
ninjadq:go-toolchain-upgrade
May 12, 2026
Merged

build(go): upgrade Go toolchain to 1.26.3 + golangci-lint to v2.12.2#43
ninjadq merged 9 commits into
Azure:mainfrom
ninjadq:go-toolchain-upgrade

Conversation

@ninjadq
Copy link
Copy Markdown
Member

@ninjadq ninjadq commented May 12, 2026

Summary

  • Bump Go toolchain from 1.24.01.26.3 (go.mod, Dockerfile, CLAUDE.md)
  • Bump golangci-lint from v1.64.8v2.12.2 because v1.64.8 (the last v1.x release) cannot lint Go 1.26 source — .golangci.yml migrated to v2 schema
  • CI workflows pick up the new Go version automatically via go-version-file: go.mod; only lint.yml needed an action/version bump

This is the toolchain-bump slice (PR #1) of the broader Go 1.26 modernization effort designed in docs/superpowers/specs/2026-05-08-go126-modernization-design.md. The linter bump (originally PR #4 in that design) was pulled forward into this PR because v1.64.8 hard-fails on Go 1.26 source. Source-code modernization (any, range n, errors.Join, etc.) and dependency upgrades remain in subsequent PRs.

Key changes

File Change
go.mod go 1.24.0go 1.26.0, add toolchain go1.26.3, drop godebug default=go1.24
Dockerfile mcr.microsoft.com/oss/go/microsoft/golang:1.24:1.26
Makefile GOLANGCI_LINT_VERSION v1.64.8v2.12.2; install path .../v2/cmd/golangci-lint
.golangci.yml Migrated to v2 schema; lint surface kept equivalent to v1.64.8
.github/workflows/lint.yml golangci-lint-action@v6@v8, version: v2.12.2
CLAUDE.md Documentation updated

Notes

  • No .go source files were touched. All public API surfaces, reconciler logic, finalizers, requeue intervals, owner references, and label/annotation keys are unchanged.
  • staticcheck.checks is set to [\"all\", \"-ST*\", \"-QF*\"] to suppress style/quickfix checks newly merged into staticcheck in v2 (these were not enabled under v1.64.8). They surface ~57 pre-existing nits worth a follow-up PR but are not introduced by this PR.
  • Mock regeneration is deferred to a follow-up PR — the locally-installed mockgen was built with Go 1.24 and produces `package requires newer Go version go1.26` errors. Existing checked-in mocks remain compatible; this matches the parent design's PR Adding Microsoft SECURITY.MD #2 sequencing.

Test Plan

  • `make fmt` — clean
  • `make vet` — clean
  • `make lint` — 0 issues under v2.12.2
  • `make test` — all packages pass under Go 1.26.3
  • `make build` — `bin/manager --help` works
  • `make test-integration` — requires Docker; verified via CI
  • `make docker-build` — requires Docker; verified via CI
  • CI green on this PR (lint, unit, integration, e2e)

ninjadq and others added 9 commits May 8, 2026 06:01
Brainstormed design for upgrading the Operation Cache Controller from
Go 1.24 to Go 1.26 with idiomatic modernization across the codebase.

Approach: 7 sequential stacked PRs (toolchain bump → mockgen regen →
direct dep upgrades → golangci-lint + new linters with suppressions →
mechanical refactor → idiomatic library swaps → Go 1.26-specific
features). Scope explicitly excludes structural and behavioral changes.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
golangci-lint v1.64.8 was built with Go 1.24 and refuses to parse
source targeting Go 1.26. v1.64.8 is the last v1.x release, so v2 is
the only forward path. .golangci.yml migrated to v2 schema; lint
surface kept equivalent to the prior config.
The Microsoft Go 1.26 base image defaults GOEXPERIMENT=systemcrypto,
which routes crypto/* through OpenSSL via cgo and requires CGO_ENABLED=1.
ms_nocgo_opensslcrypto keeps the OpenSSL backend (FIPS-friendly) but
resolves libssl via dlopen at runtime, so CGO_ENABLED=0 still produces
a static binary suitable for the distroless final stage.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
The previous attempt (ms_nocgo_opensslcrypto) avoided CGO at link time but
still dlopens libssl at runtime, which requires glibc's dynamic linker in
the final image. The distroless/minimal:3.0 base ships neither, so the
manager container failed to start with:

    exec /manager: no such file or directory

Disable systemcrypto entirely so Go's pure-Go crypto is used; the resulting
binary is fully static and runs on the minimal distroless image as before.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
@ninjadq ninjadq merged commit 456e1a4 into Azure:main May 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant