Request cancellation ignored
Query does not use context. Client disconnects still hold DB connections until the query finishes.
Before
return db.Query("SELECT ...")Suggested direction
return db.QueryContext(ctx, "SELECT ...")Go keeps the language small; production risk piles up in concurrency, context deadlines, error wrapping, and HTTP middleware chains. CodeCritic reviews your diff for goroutine safety, observability, and API contracts - not for arguing about tab width.
Review focus
Tests green while leaks and race windows remain is common in Go services. We emphasize ownership, cancellation, and error semantics on changed lines.
Profiling and bench comparisons stay in your performance workflow - automated review targets correctness and operability first.
Stacks
Retries without backoff jitter, idempotency keys missing on consumers, and protobuf fields reused against compatibility rules.
Signal handling, `flag` parsing edge cases, and jobs that exit 0 on partial failure.
Reconcile loops that fight the API server, missing leader election, and informer resync storms after error spam.
Workflow
Include the changed functions plus types they use. For HTTP handlers, add the router registration if middleware order matters.
Goroutine and context issues are prioritized because they are expensive to debug in production.
Run `-race` on packages you changed when findings mention shared state - AI does not replace the race detector.
Hook PRs so every change to auth, billing, or cluster controllers gets the same pass before merge.
Practice
Small interfaces and explicit error returns help the model reason - giant `interface{}` tunnels do not.
When renaming errors, show call sites in the review payload if they live in another file.
Document why a goroutine is fire-and-forget; otherwise reviewers assume it must respect cancellation.
GitHub Action and webhooks use the same analysis core as paste reviews - no second quality bar to maintain.
Teams on regulated infra should read data-handling docs before connecting private module proxies.
Pair with staticcheck and govet in CI; CodeCritic complements, not replaces, them.
Details: Integrations, Limitations, Pricing.
Code patterns
Small slices from real PRs. Paste similar units in the browser or run on the GitHub diff that contains them.
func handler(ctx context.Context) error {
return db.Query("SELECT ...") // ignores ctx
}Sample findings
Query does not use context. Client disconnects still hold DB connections until the query finishes.
Before
return db.Query("SELECT ...")Suggested direction
return db.QueryContext(ctx, "SELECT ...")Illustrative patterns from real review categories. Your output depends on diff size, language, and context.
FAQ
Paste a handler or connect GitHub - free tier first, team billing when you standardize.