You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two registered custom analyzers — osexitinlibrary and rawloginlib — currently run under the gh-aw multichecker binary at cmd/linters/main.go:46-49 but are not part of the -positive-selectorLINTER_FLAGS list in CI at .github/workflows/cgo.yml:1041:
# .github/workflows/cgo.yml:1041run: make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -test=false"
Audit confirms ZERO production violations of either analyzer in pkg/ (excluding _test.go and testdata/):
Analyzer
Prod violations in pkg/
osexitinlibrary
0
rawloginlib
0
This is the safest possible upgrade — enforcement is purely defensive (locks in existing discipline) with zero refactor cost. Both linters skip cmd/ and *_test.go automatically via pkg/linters/internal/filecheck.
Why this matters
os.Exit in library code bypasses defer cleanup and makes packages untestable. Library callers cannot recover.
Stdlib log.* in library code emits unstructured output to os.Stderr, bypasses pkg/logger's contextual fields, and the log.Fatal* family also calls os.Exit(1).
Both classes of bug are easy to introduce by accident (auto-imports). Without CI enforcement the discipline drifts.
Recommended Fix
Append the two flags to the LINTER_FLAGS positive selector at .github/workflows/cgo.yml:1041:
run: make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -osexitinlibrary -rawloginlib -test=false"
Summary
Two registered custom analyzers —
osexitinlibraryandrawloginlib— currently run under the gh-awmulticheckerbinary at cmd/linters/main.go:46-49 but are not part of the-positive-selectorLINTER_FLAGSlist in CI at .github/workflows/cgo.yml:1041:Audit confirms ZERO production violations of either analyzer in
pkg/(excluding_test.goandtestdata/):osexitinlibraryrawloginlibThis is the safest possible upgrade — enforcement is purely defensive (locks in existing discipline) with zero refactor cost. Both linters skip
cmd/and*_test.goautomatically via pkg/linters/internal/filecheck.Why this matters
os.Exitin library code bypassesdefercleanup and makes packages untestable. Library callers cannot recover.log.*in library code emits unstructured output toos.Stderr, bypassespkg/logger's contextual fields, and thelog.Fatal*family also callsos.Exit(1).Recommended Fix
Append the two flags to the
LINTER_FLAGSpositive selector at.github/workflows/cgo.yml:1041:The pattern follows the documented
ci_linter_enforceconvention (positive selector,-test=falseto skip stdlib test files).Validation
make golint-custom LINTER_FLAGS="-osexitinlibrary -rawloginlib -test=false"passes locally with zero diagnosticsSeverity
High — Pure CI hardening with zero code changes required. Locks in existing discipline.
Sergo Context
reverify-plus-unenforced-linter-zero-violation-auditerrstringmatch(R13),panicinlibrarycode(R19)ossetenvlibrary— still has 4 prod violations and cannot be enforced yet#aw_sg19a1(refiled) formanualmutexunlock— 16 prod sites prevent enforcementFiled by Sergo Run 20 — workflow run §26491943719