fix(lint): migrate golangci-lint config to v2 (required by Go 1.25 bump) - #74
Merged
mridulgain merged 2 commits intoAug 19, 2026
Conversation
golangci-lint v1.64.5 (pinned in Makefile) was built with Go 1.24 and
refuses to lint a module targeting a newer Go version:
Error: can't load config: the Go language version (go1.24) used to
build golangci-lint is lower than the targeted Go version (1.25.0)
This became a hard failure once go.mod's go directive was bumped to
1.25.0 (see the grpc CVE fix on the parent branch). golangci-lint's
v1 line is discontinued, so there is no newer v1.x build to pin
instead — migrated to v2.12.2.
- Ran `golangci-lint migrate` to convert .golangci.yml to the v2
schema. gosimple/stylecheck are now folded into v2's staticcheck
meta-linter (same checks, no behavior change intended).
- Bumped Makefile's GOLANGCI_VERSION to 2.12.2.
- Fixed the new findings the newer staticcheck/prealloc checks
surfaced, all pre-existing and mechanical:
- Removed embedded-field redundancy (`x.Embedded.Field` ->
`x.Field`) in server/oauth2.go, server/rotation.go, and several
storage/kubernetes files.
- Converted an equality-chain switch to a tagged switch in
server/oauth2.go.
- Preallocated a slice with known capacity in
storage/conformance/conformance.go.
- Removed two `//nolint:prealloc` directives in
connector/keystone/keystone.go that prealloc no longer flags.
- Simplified `c.Config.Field` to `c.Field` in
connector/atlassiancrowd/atlassiancrowd_test.go (embedded Config).
Verified: `golangci-lint run` reports 0 issues; go build/vet/test
pass (the one remaining test failure is the pre-existing,
unrelated SAML fixture-cert-expiry issue fixed on a separate branch,
PR #72).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…roken CI failed installing golangci-lint v2.12.2: err hash_sha256_verify checksum for '.../golangci-lint-2.12.2-linux-amd64.tar.gz' did not verify 8df580d2670fed8fa984aac0507099af8df275e665215f5c7a2ae3943893a553 vs fd3a137c7e722128143cc8932bcaa00bc73e10adadee18bdb0893453edb2c137 The computed hash (fd3a137c...) matches the checksum published for golangci-lint-2.12.2-linux-amd64.tar.gz.sbom.json, not the .tar.gz itself — install.sh's asset-matching picked the wrong file for this release. Reproduces the same way on darwin-arm64, so it's a bug in this specific release's assets/naming, not a platform issue. v2.11.0 installs correctly via the same script (verified locally), is built with go1.26.1 (satisfies the go1.25 language-version floor golangci-lint enforces against go.mod), and lints this repo with the migrated v2 config at 0 issues. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
mridulgain
merged commit Aug 19, 2026
5fdab80
into
mg/fix-trivy-ci-install-failure
9 of 10 checks passed
2 tasks
mridulgain
added a commit
that referenced
this pull request
Aug 19, 2026
…nt cleanup PR #74's golangci-lint v2 migration blanket-replaced .ObjectMeta.Name with .Name across storage/kubernetes/storage.go and types.go to resolve staticcheck's QF1008 "embedded field" suggestions. That's safe for most types here, but storage/kubernetes.Client declares its own explicit `Name string` field (the client's display name, e.g. "dex client"), which shadows the embedded k8sapi.ObjectMeta.Name (the actual Kubernetes resource name, a hash of the client ID). Go silently resolves c.Name to the shallower, explicit field, so DeleteClient/UpdateClient started PUTting/DELETEing using the display name instead of the resource name -- which fails Kubernetes' DNS1123 name validation (or worse, could target the wrong resource if the display name happened to be a valid k8s name). This is exactly why staticcheck itself never flagged these two call sites (client.go:426,496) even though the blanket sed touched them -- the quickfix check is shadow-aware and only flags genuinely equivalent simplifications. This regression was introduced by mechanically applying more replacements than the linter actually flagged. Reverts these two call sites to c.ObjectMeta.Name. Verified this was the only affected type: Connector also declares its own Name field, but its delete/put call sites already used the id parameter directly and were untouched by the sed. Fixes the storage/kubernetes TestStorage/ClientCRUD and ClientConcurrentUpdate CI failures surfaced on this branch after merging master (which includes #74). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks
mridulgain
added a commit
that referenced
this pull request
Aug 19, 2026
Fixes the storage/kubernetes TestStorage/ClientCRUD and ClientConcurrentUpdate CI failures surfaced on this branch after merging master (which includes #74). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #73 — depends on its Go 1.25 bump.
go.mod'sgodirective to 1.25.0 (needed for the grpc CVE fix), theLintCI job starts failing:golangci-lint migrateto convert.golangci.ymlto the v2 schema.gosimple/stylecheckare now folded into v2'sstaticcheckmeta-linter (same checks, no intended behavior change).Makefile'sGOLANGCI_VERSIONto2.11.0.Test plan
golangci-lint runreports 0 issuesgo build ./...,go vet ./...,go test ./...pass (one remaining failure is the pre-existing, unrelated SAML fixture-cert-expiry issue fixed in fix(UT): pin validator clock in tests to avoid fixture cert expiry #72)🤖 Generated with Claude Code