Skills

Golang Context

Idiomatic context.Context usage in Golang, propagation through API boundaries...

Install

npx skills add samber/cc-skills-golang --skill golang-context -g -a claude-code -y
Category
Design
Updated
3d ago
License
MIT
Context cost
Lightabout 1,341 tokens
Runs scripts
No, instructions only

What it does

Idiomatic context.Context usage in Golang, propagation through API boundaries, cancellation, timeouts and deadlines, request-scoped values, context.WithoutCancel for background work outliving requests. Apply when designing context propagation across layers, debugging leaked or unexpired contexts, choosing between context.Background/TODO/WithoutCancel, or storing values in context. Not for code that merely accepts ctx as first parameter.

Community default. A company skill that explicitly supersedes samber/cc-skills-golang@golang-context skill takes precedence.

Go context.Context Best Practices

context.Context is Go's mechanism for propagating cancellation signals, deadlines, and request-scoped values across API boundaries and between goroutines. Think of it as the "session" of a request, it ties together every operation that belongs to the same unit of work.

Best Practices Summary

Read the whole SKILL.md on GitHub

More in Design