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.
安装
npx skills add samber/cc-skills-golang --skill golang-contextnpx skills add samber/cc-skills-golang --skill golang-context -a claude-code -gnpx skills add samber/cc-skills-golang --skill golang-context -a codex -ggemini skills install https://github.com/samber/cc-skills-golang.git --path skills/golang-contextgh skill install samber/cc-skills-golang golang-contextgit clone --depth 1 https://github.com/samber/cc-skills-golang /tmp/samber__cc-skills-golang
mkdir -p ~/.claude/skills ~/.agents/skills
cp -R /tmp/samber__cc-skills-golang/skills/golang-context ~/.claude/skills/golang-context # Claude Code
cp -R /tmp/samber__cc-skills-golang/skills/golang-context ~/.agents/skills/golang-context # Codex, Cursor, Gemini CLI, Copilot, OpenCode