Summary
The newest (39th) custom analyzer sprintfint (pkg/linters/sprintfint/sprintfint.go) — flags fmt.Sprintf("%d", x) where x is exactly int and suggests strconv.Itoa(x) — is production-clean and has zero violations under the default lint build, but is not yet in the CI enforce list (.github/workflows/cgo.yml:1208, currently 16 flags). This matches the enforce-readiness precedent the team has repeatedly accepted (#39324, #39016, #38282, #42416).
Precision audit (CLEAN)
Type-resolved, full suppression parity
Zero-violation evidence
The only fmt.Sprintf("%d", ...) sites in ./pkg/... ./cmd/... under the default build are:
| Location |
Arg type |
Flagged? |
pkg/stringutil/stringutil.go:59 |
case int, int64, uint64: type-switch var → static type any |
No (arg type is any, not int) — correct |
pkg/console/console_wasm.go:41 also matches syntactically but is behind //go:build js || wasm, so it is not part of the default lint build (see separate build-tag blind-spot issue). Under the default build the analyzer reports 0 diagnostics across ./cmd/... ./pkg/....
Recommendation
Add -sprintfint to LINTER_FLAGS in .github/workflows/cgo.yml:1208 (the make golint-custom invocation). No production conversions are required for the default build to stay green.
Validation checklist
Effort: XS (one-flag CI change; no code conversions).
Generated by 🤖 Sergo - Serena Go Expert · 252.6 AIC · ⌖ 13.6 AIC · ⊞ 5.9K · ◷
Summary
The newest (39th) custom analyzer
sprintfint(pkg/linters/sprintfint/sprintfint.go) — flagsfmt.Sprintf("%d", x)wherexis exactlyintand suggestsstrconv.Itoa(x)— is production-clean and has zero violations under the default lint build, but is not yet in the CI enforce list (.github/workflows/cgo.yml:1208, currently 16 flags). This matches the enforce-readiness precedent the team has repeatedly accepted (#39324, #39016, #38282, #42416).Precision audit (CLEAN)
Type-resolved, full suppression parity
astutil.IsPkgSelector(pass, sel, "fmt")(sprintfint.go:58) — no shadowing FP / alias-import FN (the recurringsyntactic_stdlib_matchfamily, e.g. Linter precision: migrate the 3 remaining CI-enforced linters that match stdlib packages by identifier name to astutil.IsPkgSele [Content truncated due to length] #40243/Linter precision: two newest linters (fileclosenotdeferred, contextcancelnotdeferred) match stdlib packages by identifier name — [Content truncated due to length] #40435, does not apply here).intonly:argType != types.Typ[types.Int](:77) deliberately excludesint64/uint/named-int types, becausestrconv.Itoarequires the predeclaredint— this keeps the autofix compile-safe (verified by thegoodNamedInt/goodInt64/goodUintfixtures).nolint.BuildLineIndex+HasDirective(:33,:49) andfilecheck.IsTestFile(:46) — nonolint/test-skip gap (unlike thestrconvparseignorederror/jsonmarshalignoredeerrortest-skip gap).fmt.Sprintf("%d", 42)is correctly resolved tointand flagged (fixturebadLiteral).Zero-violation evidence
The only
fmt.Sprintf("%d", ...)sites in./pkg/... ./cmd/...under the default build are:pkg/stringutil/stringutil.go:59case int, int64, uint64:type-switch var → static typeanyany, notint) — correctpkg/console/console_wasm.go:41also matches syntactically but is behind//go:build js || wasm, so it is not part of the default lint build (see separate build-tag blind-spot issue). Under the default build the analyzer reports 0 diagnostics across./cmd/... ./pkg/....Recommendation
Add
-sprintfinttoLINTER_FLAGSin.github/workflows/cgo.yml:1208(themake golint-custominvocation). No production conversions are required for the default build to stay green.Validation checklist
make golint-custom LINTER_FLAGS="-sprintfint -test=false"reports no diagnostics on./cmd/... ./pkg/....-sprintfintadded to thecgo.ymlenforce list.Effort: XS (one-flag CI change; no code conversions).