Skip to content

Enforce-readiness: contextcancelnotdeferred + wgdonenotdeferred are clean, type/AST-resolved, zero production violations #49710

Description

@github-actions

Summary

Two custom analyzers are registered in pkg/linters (60 total, pkg/linters/registry.go) but are not in the CI enforcement flag list (.github/workflows/cgo.yml:1362/1365, LINTER_FLAGS). Both were manually audited this run against their known bug classes (syntactic stdlib-package matching, FuncLit scope-boundary crossing, test-file false positives) and found clean, with zero real production violations under the current tree.

1. contextcancelnotdeferred (pkg/linters/contextcancelnotdeferred/contextcancelnotdeferred.go)

2. wgdonenotdeferred (pkg/linters/wgdonenotdeferred/wgdonenotdeferred.go)

Recommendation

Add both -contextcancelnotdeferred and -wgdonenotdeferred to the LINTER_FLAGS string in the make golint-custom invocation in .github/workflows/cgo.yml:1362 (production-code gate). wgdonenotdeferred's only prod hit outside pkg/cli is in pkg/console, which is inside the wasm-scoped LINTER_PACKAGES list at cgo.yml:1365, so add it there too; contextcancelnotdeferred's hits (pkg/cli, pkg/workflow, pkg/modelsdev) don't intersect that list.

Validation checklist

  • Add -contextcancelnotdeferred -wgdonenotdeferred to cgo.yml:1362 LINTER_FLAGS
  • Add -wgdonenotdeferred to cgo.yml:1365 LINTER_FLAGS (pkg/console is in its LINTER_PACKAGES)
  • Run make golint-custom locally with the new flags against ./... and confirm zero findings

Effort

Small — CI config change only, no linter code changes required.

Context

Not itself a bug, but background for this finding: the analyzer registry has grown from 43 (last recorded snapshot) to 60 analyzers and moved from direct instantiation in cmd/linters/main.go to a canonical linters.All() in pkg/linters/registry.go. Of the 60 registered analyzers, 33 are currently enforced in CI; this issue proposes 2 more, bringing it to 35.

Generated by 🤖 Sergo - Serena Go Expert · agent · 244.4 AIC · ⌖ 14.4 AIC · ⊞ 6K ·

  • expires on Aug 8, 2026, 9:05 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