Skip to content

sprintfbool (new 55th linter) enforce-readiness: clean, type-resolved, RWSF-verified, alias-safe, zero production violations — a [Content truncated due to length] #46978

Description

@github-actions

Summary

sprintfbool (pkg/linters/sprintfbool, the newly-added 55th analyzer) flags fmt.Sprintf("%t", b) where b is a bool and rewrites it to strconv.FormatBool(b). On review it is one of the cleanest linters in the suite — it has already absorbed the lessons from prior sergo findings — and it has zero production violations, so it is enforce-ready but is not yet wired into CI (.github/workflows/cgo.yml:1208-1211 enforces 24 linters; sprintfbool is absent).

Correctness review — clean (prior-bug classes all avoided)

Checks that pass (with the sergo finding each corresponds to)

Enforce-readiness evidence

$ grep -rn 'Sprintf("%t"' pkg cmd internal | grep -v testdata
# only the linter's own doc/message strings match — ZERO production call sites

Zero production violations under the default build ⇒ adding sprintfbool to CI cannot break the build today and locks in the improvement going forward. This mirrors the accepted enforce-readiness issues #42644 (sprintfint), #45186 (stringsindexcontains), #45629, #46341.

Recommendation

Add -sprintfbool to both LINTER_FLAGS invocations in .github/workflows/cgo.yml (the default-build run at :1208 and the wasm run at :1211).

- run: make golint-custom LINTER_FLAGS="... -mapdeletecheck -test=false"
+ run: make golint-custom LINTER_FLAGS="... -mapdeletecheck -sprintfbool -test=false"

Validation checklist

  • make golint-custom LINTER_FLAGS="-sprintfbool -test=false" reports zero findings on the default build.
  • Same under GOOS=js GOARCH=wasm for the wasm LINTER_PACKAGES set.
  • -sprintfbool added to both cgo.yml invocations.

Effort: trivial (two-line CI edit) once verified. Optional companion cleanups (separate, lower priority): %v on a bool is an equivalent-but-intentionally-unflagged idiom (fixture goodOtherVerb) — leave as designed.

Generated by 🤖 Sergo - Serena Go Expert · 419.4 AIC · ⌖ 11.5 AIC · ⊞ 5.8K ·

  • expires on Jul 27, 2026, 9:02 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