Summary
pkg/linters/doc.go has drifted out of sync with the analyzer registry again. The package header claims 53 analyzers, but cmd/linters/main.go registers 54. The omitted entry is timenowsub.
This is the same recurring drift class previously filed and fixed as #46527 (52→53), #46131, #45185, and #40436. The doc header is hand-maintained and lags each new-linter landing.
Evidence
pkg/linters/doc.go:3 — // All 53 active analyzers:
- The bulleted list in
doc.go contains exactly 53 // - <name> entries.
cmd/linters/main.go multichecker.Main(...) registers 54 analyzers (grep -c Analyzer cmd/linters/main.go = 54, one per line, lines 77–130).
- The list jumps from
timeafterleak → timesleepnocontext → tolowerequalfold; the registered timenowsub.Analyzer (main.go:125) has no corresponding bullet.
Impact
Low severity but recurring: the header count and enumerated list are the human-facing catalogue of the lint suite. A missing entry means timenowsub (and its rationale) is invisible to anyone reading the package doc, and the count assertion is simply wrong. It also tends to accumulate — #46131 showed 6 linters silently omitted at once.
Recommendation
- Add the missing bullet in alphabetical position (between
timeafterleak/timesleepnocontext cluster — specifically after timesleepnocontext per the current ordering, matching main.go's grouping) :
// - timenowsub — reports time.Now().Sub(t) calls that should be simplified to time.Since(t)
- Bump the header to
// All 54 active analyzers:.
Validation checklist
Effort
Trivial (one-line doc edit + header bump). The optional CI guard is a small follow-up that would retire this whole issue class.
Sergo R61 — new-linter/doc-sync audit. appendoneelement and timenowsub (the two linters added since R60 without prior issues) were both audited; appendoneelement is correctness-clean.
Generated by 🤖 Sergo - Serena Go Expert · 243.2 AIC · ⌖ 11 AIC · ⊞ 5.8K · ◷
Summary
pkg/linters/doc.gohas drifted out of sync with the analyzer registry again. The package header claims 53 analyzers, butcmd/linters/main.goregisters 54. The omitted entry istimenowsub.This is the same recurring drift class previously filed and fixed as #46527 (52→53), #46131, #45185, and #40436. The doc header is hand-maintained and lags each new-linter landing.
Evidence
pkg/linters/doc.go:3—// All 53 active analyzers:doc.gocontains exactly 53// - <name>entries.cmd/linters/main.gomultichecker.Main(...)registers 54 analyzers (grep -c Analyzer cmd/linters/main.go= 54, one per line, lines 77–130).timeafterleak→timesleepnocontext→tolowerequalfold; the registeredtimenowsub.Analyzer(main.go:125) has no corresponding bullet.Impact
Low severity but recurring: the header count and enumerated list are the human-facing catalogue of the lint suite. A missing entry means
timenowsub(and its rationale) is invisible to anyone reading the package doc, and the count assertion is simply wrong. It also tends to accumulate — #46131 showed 6 linters silently omitted at once.Recommendation
timeafterleak/timesleepnocontextcluster — specifically aftertimesleepnocontextper the current ordering, matching main.go's grouping) :// All 54 active analyzers:.Validation checklist
doc.goheader readsAll 54 active analyzers:doc.gobullet list has 54 entries and includestimenowsub// -bullets equalsgrep -c Analyzer cmd/linters/main.goEffort
Trivial (one-line doc edit + header bump). The optional CI guard is a small follow-up that would retire this whole issue class.
Sergo R61 — new-linter/doc-sync audit.
appendoneelementandtimenowsub(the two linters added since R60 without prior issues) were both audited;appendoneelementis correctness-clean.