Skip to content

fix(deps): update golang.org/x/term to v0.48.0 and manage golangci-lint via go tool - #87

Merged
ramseydsilva merged 2 commits into
mainfrom
chore/golangci-lint-go-tool
Nov 17, 2026
Merged

ramseydsilva merged 2 commits into
mainfrom
chore/golangci-lint-go-tool

Conversation

@displague

Copy link
Copy Markdown
Member

Supersedes #84. Closes #84

Why

#84 bumps golang.org/x/term to v0.48.0, which raises the go directive to 1.26.0. The lint job then fails because the prebuilt golangci-lint v2.3.0 binary was built with go1.24:

can't load config: the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.26.0)

The golangci-lint version was pinned in the Makefile, and Renovate doesn't track it there.

What

  • Includes fix(deps): update module golang.org/x/term to v0.48.0 #84: golang.org/x/term v0.36.0 → v0.48.0 (x/sys → v0.50.0, go 1.26.0).
  • Adds a separate tools module (tools/go.mod) with a tool directive for golangci-lint (now v2.15.0). It's kept out of the main go.mod so golangci-lint's large dependency tree can't raise the application's dependencies. Renovate's gomod manager picks up tools/go.mod like any other go.mod.
  • Makefile: GOLANGCI_LINT=go tool -modfile=tools/go.mod golangci-lint (removes GOLANGCI_LINT_VERSION).
  • CI: builds golangci-lint from tools/go.mod with the toolchain from go.mod, then runs golangci-lint-action with install-mode: none, so we keep its caching and annotations. setup-go caching now includes tools/go.sum.
  • reflect.Ptr → reflect.Pointer in internal/register/register.go. The newer govet inline analyzer flags the deprecated alias.

⚠️ For team discussion: CI time

This builds golangci-lint from source on every lint run instead of downloading a prebuilt binary. That means compiling a few hundred packages. setup-go's module/build cache should absorb most of the cost on warm runs, but cold runs (first run, cache eviction, every Renovate bump of golangci-lint) will be noticeably slower. Please compare this PR's lint job time with main before we decide.

Alternatives if the time is unacceptable:

  • Keep the prebuilt binary (install-mode: binary) and have the workflow read the version from tools/go.mod. Renovate still tracks the version, but the binary's own Go version can again fall behind our go directive until golangci-lint releases.
  • Keep the Makefile pin and add a Renovate customManagers regex for GOLANGCI_LINT_VERSION.
  • Cache the built binary explicitly, keyed on hashFiles('tools/go.sum') plus the Go version.

The golangci-lint maintainers recommend against installing via go tool/go install, mainly because dependencies may resolve differently from their tested release. Using an isolated tools module reduces this risk but doesn't remove it.

Verified locally

make lint (0 issues), go build ./..., go test ./....

🤖 Generated with Claude Code

…nt via go tool

Bumping golang.org/x/term raises the go directive to 1.26.0, which the
prebuilt golangci-lint v2.3.0 binary (built with go1.24) refuses to lint.

Track golangci-lint as a Go tool dependency in a separate tools/go.mod so
Renovate updates it and it is built with the toolchain from go.mod. Bump
it to v2.15.0 and replace deprecated reflect.Ptr with reflect.Pointer,
flagged by the newer govet inline analyzer.

Closes #84

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
go.sum
tools/go.sum
# golangci-lint is versioned as a Go tool dependency in tools/go.mod (kept
# separate from the application module) so Renovate keeps it up to date.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I've been thinking about since upgrading the github.com/equinix/pulumi-equinix CI toolchain is that we may want to adopt mise (or something similar, but mise is what Pulumi uses) for managing dependencies like language and linter versions across all of our repos (Python/Java/Go SDKs, CLI, Terraform provider, etc.). Renovate apparently supports upgrading dependencies declared in mise.toml.

That said, for now at least this seems fine to me; I don't remember why we adopted this pattern of keeping the lint version in the Makefile (I think it originated in either equinix-sdk-go or terraform-provider-equinix) and restoring Renovate upgrades is good.

@ramseydsilva ramseydsilva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ramseydsilva
ramseydsilva marked this pull request as ready for review November 17, 2026 21:19
@ramseydsilva
ramseydsilva merged commit 5b489e4 into main Nov 17, 2026
6 checks passed
@ramseydsilva
ramseydsilva deleted the chore/golangci-lint-go-tool branch November 17, 2026 21:22
@github-actions

Copy link
Copy Markdown

This PR is included in version 0.6.0 🎉

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.

3 participants