
Golang Context
Teaches Claude how to handle context.Context idiomatically in Go: propagation through call chains, cancellation patterns, timeouts, and context values. The core principle is simple but easy to mess up: pass the same context through your entire request lifecycle, never create a fresh context.Background() mid-chain, and always defer cancel(). Covers the gotchas like when to use TODO() versus Background(), why you shouldn't store contexts in structs, and how to use context values without namespace collisions. Includes patterns for HTTP handlers, database calls, and cross-service tracing. Most useful when you're building services that need proper cancellation propagation or you keep getting context usage wrong in code reviews.
- skills.sh installs
- 42.7K
- GitHub stars
- 3.8K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add samber/cc-skills-golang --skill golang-context --agent claude-codeInstalls into .claude/skills of the current project.
Files
Community default. A company skill that explicitly supersedes
samber/cc-skills-golang@golang-contextskill 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
Sponsors
Details
- Repository
- github.com/samber/cc-skills-golang
- Categories
- Backend & APIs, Debugging, Go
- First seen
- Apr 16, 2026
More from samber/cc-skills-golang
All 47- Golang Naming42.5K
- Golang Database42.5K
- Golang Safety42.2K
- Golang Project Layout42.1K
- Golang Documentation42K
- Golang Modernize42K
- Golang Lint41.9K
- Golang Data Structures41.8K
- Golang Troubleshooting41.6K
- Golang Observability41.5K
- Golang Dependency Management41.4K
- Golang Structs Interfaces41.3K
- Golang Cli41.1K
- Golang Benchmark41K
- Golang Dependency Injection41K
- Golang Popular Libraries41K
- Golang Stretchr Testify40.9K
- Golang Continuous Integration40.9K
- Golang Grpc40.7K
- Golang Samber Lo40K
- Golang Stay Updated40K
- Golang Samber Do39.8K
- Golang Samber Slog39.8K
- Golang Samber Oops39.7K