What problem does it solve?
Prevents Go context bugs that break cancellation/timeouts, leak resources, or lose request-scoped metadata when building HTTP handlers, service layers, database calls, and outbound requests.
Core Features & Use Cases
- Correct context propagation across handler → service → DB → external calls, ensuring cancellation and deadlines flow consistently through the entire call chain.
- Resource-safe derived contexts using context.WithCancel/WithTimeout/WithDeadline with guaranteed cancel() calls on all scoped paths to avoid leaks.
- Request-scoped metadata best practices for context values, including safe typed keys, and choosing context values only for request metadata (not business parameters or infrastructure dependencies).
- Background work with context values preserved using context.WithoutCancel (Go 1.21+) so audit/log tasks outlive the request while keeping trace/correlation values.
- Deep dives and references for HTTP/service calls, cancellation and timeouts, and context value tracing to support consistent implementation and debugging.
Quick Start
Use the golang-context skill to refactor your Go request pipeline so every downstream operation receives the correct ctx, including cancellable DB queries and context-aware outbound HTTP requests.