Repository navigation
Description
Summary
Registry has grown from 43 to 62 analyzers since the last audited baseline (R60), but CI (.github/workflows/cgo.yml, lint-go job, LINTER_FLAGS) only enforces 39. Of the 23 unenforced linters, these 4 are fully wired (type-resolved detection, internal/nolint + internal/filecheck support), have their previously-filed correctness bugs already fixed in code, and have zero production violations under the default build — the standard bar this repo uses before flipping a linter on in CI (matching prior batched issues #45629, #47916, #49710).
Evidence per linter
uncheckedflushreturn (62nd/newest linter) — click to expand
pkg/linters/uncheckedflushreturn/uncheckedflushreturn.go- Node filter covers
ExprStmt,AssignStmt, andDeferStmt(theDeferStmtgap from the prior issue is fixed —checkDiscardedFlushDeferat line 106). - Type-resolved: verifies the callee is named
Flush, takes no args, and returns exactly one value satisfying theerrorinterface (isFlushCallReturningError, lines 127-148). nolint/filecheckwired and exercised in tests (testdata/.../uncheckedflushreturn.go:27,57).- Zero production violations: repo-wide grep for
.Flush()outside tests/testdata finds only 2 call sites (pkg/cli/logs_format_compact.go:140,322), both already check the returned error.
bytescomparestring — click to expand
pkg/linters/bytescomparestring/bytescomparestring.go- The prior "inaccurate allocates premise" issue (bytescomparestring (new 44th linter): the "allocates" premise is inaccurate under gc — string(a) == string(b) does NOT allocate [Content truncated due to length] #44484) is fixed — the message now reads "is a []byte comparison written the long way" (lines 93, 104), not an allocation claim.
- Type-resolved (
extractByteSliceStringConvusestypes.Basic/IsByteSlice), autofix handles import-qualifier shadowing and dedups import edits per file (bytesQualifier,addBytesImportEdit) — the import-robustness class of bug from Autofix import robustness: sprintfint/writebytestring/bytescomparestring key import-presence on the path but emit a hardcoded pa [Content truncated due to length] #45037 does not apply here. - Zero production violations: repo-wide grep for
string(x) == string(y)/!=[]byte-typed patterns finds no real matches (only the doc.go description string).
nilctxpassed — click to expand
pkg/linters/nilctxpassed/nilctxpassed.go- The prior variadic-spread false positive (nilctxpassed: spread call f(nil...) to a variadic context.Context param is a false positive — nil variadic slice misreported as
[Content truncated due to length] #45903) is fixed —
call.Ellipsis.IsValid()guard present at line 70, sof(nilSlice...)is no longer misreported as passing a literalnilcontext. nolint/filecheckwired (lines 26, 36, 40).- No production sites found passing literal
nilto acontext.Contextparameter.
stringbytesroundtrip — click to expand
pkg/linters/stringbytesroundtrip/stringbytesroundtrip.go- The prior defensive-copy false positive (stringbytesroundtrip: the []byte(string(b)) arm mislabels the defensive-copy idiom as a "redundant round-trip" — a false-positiv
[Content truncated due to length] #47704) is fixed — the
[]byte(string(b))arm is now correctly documented and reported as a "wasteful two-copy clone" recommendingslices.Clone/bytes.Clone(line 126), not mislabeled as a redundant round-trip. - Zero production violations: repo-wide grep for
[]byte(string(...))/string([]byte(...))outside tests/testdata finds no real matches (only the doc.go description string).
Recommendation
Add all 4 flags to both LINTER_FLAGS invocations in .github/workflows/cgo.yml (lint-go job, "Run custom linters" and "Run custom linters (wasm)" steps):
-uncheckedflushreturn -bytescomparestring -nilctxpassed -stringbytesroundtrip
Validation checklist
- Confirm
make golint-custom LINTER_FLAGS="...new flags... -test=false"passes clean onmainfor both the default andGOOS=js GOARCH=wasmbuilds - Add the 4 flags to both
LINTER_FLAGSstrings in.github/workflows/cgo.yml - Re-run CI once to confirm no unexpected violations surface under the wasm-specific package subset (
./pkg/console ./pkg/parser ./pkg/styles ./pkg/tty ./pkg/workflow)
Effort
Small — no source changes required, only a CI config edit plus a verification run.
Generated by 🤖 Sergo - Serena Go Expert · agent · 234 AIC · ⌖ 31.8 AIC · ⊞ 6K · ◷
- expires on Aug 10, 2026, 9:03 PM UTC-08:00
Activity