The lint job in .github/workflows/ci.yml runs golangci-lint and go vet from the repository root. Under go.work that covers the root module only, so the other five workspace modules are unlinted — and they are red.
This is the same defect as LeanerCloud/cloud-commitments-cli#1751 (test jobs root-only), in the same file, one job over. LeanerCloud/cloud-commitments-cli#1751 fixes the test steps; this issue is deliberately kept separate so a lint-debt excavation does not bury a CI-gating fix, and vice versa.
Measured
golangci-lint run at the CI-pinned v2.10.1, per module, counts from golangci's own summary:
| module |
issues |
. (root, the only one CI lints) |
0 |
pkg |
205 |
providers/aws |
272 |
providers/azure |
592 |
providers/gcp |
222 |
tests/e2e |
tool error, see below |
| total unlinted |
1291 |
tests/e2e exits 5 with context loading failed: no go files to analyze — every file in it is behind //go:build e2e, so it needs --build-tags=e2e to be linted at all. Same root cause as the go test half of LeanerCloud/cloud-commitments-cli#1751.
Not all of it is cosmetic — but less of it is serious than first stated
Correction. An earlier revision of this issue called the 193 bodyclose findings "a resource-leak class on a provider that makes real API calls" and recommended triaging them first. That was wrong, and the correction inverts the recommendation. All 193 are in _test.go files — zero in production code — and they sit on okJSONResponse(...), a helper that hand-builds *http.Response fixtures for a fake HTTP client. There is no network resource behind them. Volume aside, they are the least urgent part of this backlog, not the most.
Split by production versus test code, which is the split that decides urgency:
| linter |
production |
test |
errcheck |
18 |
0 |
unused |
12 |
6 |
staticcheck |
10 |
1 |
errorlint |
8 |
0 |
gosec |
1 |
0 |
bodyclose |
0 |
193 |
So the set actually worth triaging is 49 production findings — errcheck 18 (unchecked errors, spread across all four modules), unused 12, staticcheck 10, errorlint 8 (providers/gcp), gosec 1 (providers/aws). Everything else is godot (502), misspell (201), gocritic (80) and the test-only bodyclose block.
Suggested approach
Mirror the per-module loop already used by govulncheck (ci.yml:312), the gosec SARIF scan (:333), and — once LeanerCloud/cloud-commitments-cli#1751 lands — the test steps. But do not turn the gate on and fix 1291 findings in one PR. Suggested split:
- Triage the 49 production findings first (
errcheck, unused, staticcheck, errorlint, gosec) — these are the ones that can represent real defects, and the set is small enough to review individually.
- Handle the 193 test-only
bodyclose findings separately — LeanerCloud/cloud-commitments-cli#1759. Volume, not risk.
- Land the cosmetic sweep (
godot, misspell, gocritic) separately, ideally with --fix, in its own PR. Note the standing caution that autofix must not rewrite SQL identifiers or test-asserted strings.
- Only then add the modules to the lint loop, so the gate goes green on the same commit it goes live.
Reversing that order means either a long-red main or a suppressed gate, and suppressing is not on the table.
Verification
Same shape as LeanerCloud/cloud-commitments-cli#1751: after the loop is added, break a lint rule deliberately in providers/azure and confirm CI goes red. Before the change it will not.
Related
The
lintjob in.github/workflows/ci.ymlrunsgolangci-lintandgo vetfrom the repository root. Undergo.workthat covers the root module only, so the other five workspace modules are unlinted — and they are red.This is the same defect as LeanerCloud/cloud-commitments-cli#1751 (test jobs root-only), in the same file, one job over. LeanerCloud/cloud-commitments-cli#1751 fixes the test steps; this issue is deliberately kept separate so a lint-debt excavation does not bury a CI-gating fix, and vice versa.
Measured
golangci-lint runat the CI-pinned v2.10.1, per module, counts from golangci's own summary:.(root, the only one CI lints)pkgproviders/awsproviders/azureproviders/gcptests/e2etests/e2eexits 5 withcontext loading failed: no go files to analyze— every file in it is behind//go:build e2e, so it needs--build-tags=e2eto be linted at all. Same root cause as thego testhalf of LeanerCloud/cloud-commitments-cli#1751.Not all of it is cosmetic — but less of it is serious than first stated
Split by production versus test code, which is the split that decides urgency:
errcheckunusedstaticcheckerrorlintgosecbodycloseSo the set actually worth triaging is 49 production findings —
errcheck18 (unchecked errors, spread across all four modules),unused12,staticcheck10,errorlint8 (providers/gcp),gosec1 (providers/aws). Everything else isgodot(502),misspell(201),gocritic(80) and the test-onlybodycloseblock.Suggested approach
Mirror the per-module loop already used by
govulncheck(ci.yml:312), the gosec SARIF scan (:333), and — once LeanerCloud/cloud-commitments-cli#1751 lands — the test steps. But do not turn the gate on and fix 1291 findings in one PR. Suggested split:errcheck,unused,staticcheck,errorlint,gosec) — these are the ones that can represent real defects, and the set is small enough to review individually.bodyclosefindings separately — LeanerCloud/cloud-commitments-cli#1759. Volume, not risk.godot,misspell,gocritic) separately, ideally with--fix, in its own PR. Note the standing caution that autofix must not rewrite SQL identifiers or test-asserted strings.Reversing that order means either a long-red
mainor a suppressed gate, and suppressing is not on the table.Verification
Same shape as LeanerCloud/cloud-commitments-cli#1751: after the loop is added, break a lint rule deliberately in
providers/azureand confirm CI goes red. Before the change it will not.Related
providers/aws, a module CI neither tested nor linted.providers/awsfindings — 272 with and without it, identical per-linter breakdown. All 272 predate it.