New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Idiomatic context.Context guidance for propagation, cancellation, timeouts, values, and detached background work in Go.

skills.sh installs
43.2K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers propagation through API boundaries, cancellation, timeouts and deadlines, request-scoped values, and context.WithoutCancel
  • Includes deep-dive references on cancellation, value keys and tracing, and HTTP handlers and database calls
  • Enforces passing context through parameters instead of structs, and creating context.Background() only at entry points
  • Designed for Go services that need consistent request-scoped cancellation, with linting via govet and staticcheck

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-context -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

Details

Repository
github.com/samber/cc-skills-golang
Category
Go
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Context

More Go