Synaptic SkillsSynapticSkills
MarketplaceSkill GraphCriar SkillMCP ServerPlataformaEnterprise
v0.1.0-beta
Voltar ao Marketplace
DevelopmentMédio

Go context.Context Best Practices

porsamber·samber· v1.0.0 · atualizado em 2026-04-10
80
Score

Idiomatic context.Context usage in Golang — creation, propagation, cancellation, timeouts, deadlines, context values, and cross-service tracing. Apply when working with context.Context in any Go code.

gogolangcontextconcurrencyerror-handlingbest-practices
0Stars
0Forks
0Usos
Fork

Documento do Skill

SKILL.mdgolang-context/workflow
1
Identify the need for context: — Determine where context is needed for cancellation, timeouts, or request-scoped values.
2
Create the context: — Use `context.Background()`, `context.TODO()`, `r.Context()`, `context.WithCancel()`, or `context.WithTimeout()` as appropriate.
3
Propagate the context: — Pass the context as the first argument to all downstream functions.
4
Use context-aware functions: — Use `*Context` variants of standard library functions (e.g., `QueryContext`, `ExecContext`).
5
Handle cancellation: — Listen for cancellation signals using `<-ctx.Done()` and clean up resources.
6
Defer cancellation: — If using `context.WithCancel()`, `context.WithTimeout()`, or `context.WithDeadline()`, defer the `cancel()` function immediately after creation.
7
Consider context values: — If necessary, store request-scoped metadata in context values using unexported key types.

Telemetria de Agentes

Execuções
0
total
Taxa de Sucesso
0%
últimos 30d
Latência Média
0.0s
p50
Alucinação
0.0%
detecção
Tokens Entrada
0
avg 0/exec
Tokens Saída
0
avg 0/exec

Uso por Plataforma

Skills Relacionados

Compõe comGo Concurrency Best Practices
70%
Hebbian Synapse
Composite0.700
w = 0.3·α + 0.5·β + 0.2·γ
85
Compõe comGo Design Patterns & Idioms
70%
Hebbian Synapse
Composite0.700
w = 0.3·α + 0.5·β + 0.2·γ
83
Compõe com ←Go Database Best Practices
70%
Hebbian Synapse
Composite0.700
w = 0.3·α + 0.5·β + 0.2·γ
83
Compõe com ←Go Observability Best Practices
70%
Hebbian Synapse
Composite0.700
w = 0.3·α + 0.5·β + 0.2·γ
80
Compõe com ←Go gRPC Best Practices
70%
Hebbian Synapse
Composite0.700
w = 0.3·α + 0.5·β + 0.2·γ
84
Similar aSolana Development Skill (framework-kit-first)
60%
Hebbian Synapse
Composite0.600
w = 0.3·α + 0.5·β + 0.2·γ
85
Similar aCoder
60%
Hebbian Synapse
Composite0.600
w = 0.3·α + 0.5·β + 0.2·γ
81
Similar aElysiaJS Development Skill
60%
Hebbian Synapse
Composite0.600
w = 0.3·α + 0.5·β + 0.2·γ
84

Árvore do Skill

Go context.Context Best Practices
golang-context
Fases Cognitivas5
1.SENSE
2.CONTEXTUALIZE
3.RECOMMEND
4.ACT
5.REFLECT
Triggers8
use context in Gopropagate context in Golanghandle cancellation in Goimplement timeouts in Gopass request values in Gouse context.Context in Gocreate context in Gopropagate cancellation signals in Go

Avaliar este Skill

Score Breakdown

⭐Avaliação Humana0%
🤖Sucesso de Agentes0%
🕐Atualidade100%
🔗Saúde de Dependências100%
🕸️Centralidade no Grafo0%
🛡️Segurança50%
CompositeScore = α·Humano + β·Agente + γ·Recência + δ·Deps + ε·Centralidade + ζ·Segurança

Instalação

$ synaptic mcp download golang-context
$ synaptic skills detail golang-context
$ synaptic skills live golang-context

Links

GitHub Repository