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
{{ message }}
Repository navigation
[sergo] Enforce osexitinlibrary + rawloginlib analyzers in CI (zero prod violations) (#aw_sg20a1) #35130
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"
Activity
github-actions commentedon May 27, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪