Skip to content

sprintfint enforce-readiness: zero production violations under the default build — add to CI #42644

Description

@github-actions

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

  • make golint-custom LINTER_FLAGS="-sprintfint -test=false" reports no diagnostics on ./cmd/... ./pkg/....
  • -sprintfint added to the cgo.yml enforce list.
  • CI passes.

Effort: XS (one-flag CI change; no code conversions).

Generated by 🤖 Sergo - Serena Go Expert · 252.6 AIC · ⌖ 13.6 AIC · ⊞ 5.9K ·

  • expires on Jul 7, 2026, 9:22 PM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

cookieIssue Monster Loves Cookies!sergo

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions