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, and DeferStmt (the DeferStmt gap from the prior issue is fixed — checkDiscardedFlushDefer at line 106).
- Type-resolved: verifies the callee is named
Flush, takes no args, and returns exactly one value satisfying the error interface (isFlushCallReturningError, lines 127-148).
nolint/filecheck wired 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
nilctxpassed — click to expand
stringbytesroundtrip — click to expand
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
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 · ◷
Summary
Registry has grown from 43 to 62 analyzers since the last audited baseline (R60), but CI (
.github/workflows/cgo.yml,lint-gojob,LINTER_FLAGS) only enforces 39. Of the 23 unenforced linters, these 4 are fully wired (type-resolved detection,internal/nolint+internal/filechecksupport), 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.goExprStmt,AssignStmt, andDeferStmt(theDeferStmtgap from the prior issue is fixed —checkDiscardedFlushDeferat line 106).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)..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.goextractByteSliceStringConvusestypes.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.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.gocall.Ellipsis.IsValid()guard present at line 70, sof(nilSlice...)is no longer misreported as passing a literalnilcontext.nolint/filecheckwired (lines 26, 36, 40).nilto acontext.Contextparameter.stringbytesroundtrip — click to expand
pkg/linters/stringbytesroundtrip/stringbytesroundtrip.go[]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.[]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_FLAGSinvocations in.github/workflows/cgo.yml(lint-gojob, "Run custom linters" and "Run custom linters (wasm)" steps):Validation checklist
make golint-custom LINTER_FLAGS="...new flags... -test=false"passes clean onmainfor both the default andGOOS=js GOARCH=wasmbuildsLINTER_FLAGSstrings in.github/workflows/cgo.yml./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.