Skip to content

Commit b763f01

Browse files
committed
ci: unbreak the lint job under Go 1.27
golangci-lint v2.12.2 is built with go1.26 and panics while typechecking the Go 1.27 standard library: panic: file requires newer Go version go1.27 (application built with go1.26) The workflow installs `stable`, which now resolves to 1.27.1, so the job fails before it reaches any of this repository's code. Bump the pin to v2.13.2, which is built with go1.27. That version renames one linter and surfaces two issues the old one did not: - exhaustruct ships its v5 rewrite under a new name, and only the new name matches from v2.13 on, so the existing disable entry silently stopped applying. List both, the way gomodguard already is. - The goconst half of the nolint directive on replaceSemanticPaths no longer suppresses anything. Drop it, keep the gochecknoglobals half. - pkg/engine/helm carries upstream's canonical-import-path comment, which Go ignores in module mode. Exclude the package from modernize rather than editing a file whose whole point is staying close to upstream. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 7d48e60 commit b763f01

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

‎.github/workflows/pr.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Run golangci-lint
4444
uses: golangci/golangci-lint-action@v7
4545
with:
46-
version: v2.12.2
46+
version: v2.13.2
4747
args: --timeout=10m
4848

4949
dco:

‎.golangci.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@ linters:
44
default: all
55
disable:
66
- depguard
7+
# exhaustruct: v2.13 ships the v5 rewrite under a new name and keeps
8+
# both generations enabled under `default: all`, so disabling one
9+
# leaves the other reporting. Both names are needed.
10+
#
11+
# This pins a floor: `run` on v2.12.2 dies with
12+
# `unknown linters: 'exhaustruct_v5'` before it analyses anything
13+
# (`config verify` does not catch it). That matches the version this
14+
# repository pins in CI, so a local binary has to keep up with it.
715
- exhaustruct
16+
- exhaustruct_v5
817
- gochecknoinits
918
- wsl
1019
- lll
@@ -135,6 +144,13 @@ linters:
135144
# failed for the same reason. Disable goconst on test files.
136145
- goconst
137146
path: _test\.go
147+
# pkg/engine/helm is a copy of helm.sh/helm/v4/pkg/engine kept close
148+
# to upstream so it can be re-synced. Its doc.go carries upstream's
149+
# canonical-import-path comment, which Go ignores in module mode;
150+
# rewriting it would buy nothing and add a diff against upstream.
151+
- linters:
152+
- modernize
153+
path: pkg/engine/helm/
138154

139155
formatters:
140156
enable:

‎pkg/engine/engine.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ func pruneBodyIdentitiesAgainstRendered(body, rendered []byte) ([]byte, bool, er
935935
// upstream replace then leaves rendered untouched. Skipping kicks in
936936
// only on the partial-edit branches below the deep-equal check.
937937
//
938-
//nolint:gochecknoglobals,goconst // immutable lookup table consulted by pruneIdenticalKeysAt; init-time literal, never mutated. The second occurrence of each path string is in the docstring above (where it documents the v1alpha1 merge behaviour); making it a const just to satisfy goconst would split documentation from data without runtime benefit.
938+
//nolint:gochecknoglobals // immutable lookup table consulted by pruneIdenticalKeysAt; init-time literal, never mutated.
939939
var replaceSemanticPaths = map[string]struct{}{
940940
"cluster/network/podSubnets": {},
941941
"cluster/network/serviceSubnets": {},

0 commit comments

Comments
 (0)