Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill golang-patterns명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | golang-patterns |
| description | >- Use when this capability is needed. |
Idiomatic Go reference pack — concurrency, interfaces, generics, testing, project structure, plus the anti-patterns agents most commonly get wrong. Two-thesis stack:
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Concurrency | references/concurrency.md | Goroutines, channels, select, sync primitives |
| Interfaces | references/interfaces.md | Interface design, io.Reader/Writer, composition |
| Generics | references/generics.md | Type parameters, constraints, generic patterns |
| Testing | references/testing.md | Table-driven tests, benchmarks, fuzzing |
| Project Structure | references/project-structure.md | Module layout, internal packages, go.mod |
| Idiomatic Go (anti-patterns) | references/idiomatic-go.md | Quick anti-pattern → idiomatic-fix tables, decision rules, agent-specific rationalization counters |
go vet ./... before proceedinggolangci-lint run and fix all reported issues before proceeding-race, fuzzing, 80%+ coverage; race detector must pass before committingGoroutine with context cancellation and error propagation:
// worker runs until ctx is cancelled or an error occurs.
// Errors are returned via errCh; the caller must drain it.
func worker(ctx context.Context, jobs <-chan Job, errCh chan<- error) {
for {
select {
case <-ctx.Done():
errCh <- fmt.Errorf("worker cancelled: %w", ctx.Err())
return
case job, ok := <-jobs:
if !ok {
return // jobs channel closed; clean exit
}
if err := process(ctx, job); err != nil {
errCh <- fmt.Errorf("process job %v: %w", job.ID, err)
return
}
}
}
}
func runPipeline(ctx context.Context, jobs []Job) error {
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()
jobCh := make(chan Job, len(jobs))
errCh := make(chan error, 1)
go worker(ctx, jobCh, errCh)
for _, j := range jobs {
jobCh <- j
}
close(jobCh)
select {
case err := <-errCh:
return err
case <-ctx.Done():
return fmt.Errorf(, ctx.Err())
}
}
Key properties: bounded goroutine lifetime via ctx, error propagation with
%w, no goroutine leak on cancellation.
context.Context as first param on all blocking operations_ discards without justification)X | Y union constraints for generics (Go 1.18+)fmt.Errorf("...: %w", err)-race flag)_ = thatMightFail() without a comment)panic for normal error handlingWhen implementing Go features, provide:
golang-pro agent — broader architectural / DevOps coverage; delegates
pattern detail here. Load both when active Go development is in scope.Initial content adapted from
jeffallan/claude-skills (MIT,
skills/golang-pro) and the prior wardrobe idiomatic-go skill (Bodner-derived
anti-pattern tables, now at references/idiomatic-go.md). See LICENSES.md.
Source: danmestas/wardrobe — distributed by TomeVault.