golang-concurrency

검토 · 73
Registry 색인

Golang concurrency patterns. Use when writing or reviewing concurrent Go code involving goroutines, channels, select, locks, sync primitives, errgroup, singleflight, worker pools, or fan-out/fan-in pipelines. Also triggers when you detect goroutine leaks, race conditions, channel

Verified installs0
스타3.0K
버전1.0.0
품질82/100 · 강함
신뢰73/100 · 샌드박스 전용
감사85/100 · 안전하게 시도 가능

공급 자산 프로필

코딩 및 개발 Agent

코드 리뷰, 저장소 분석, 테스트, CI, GitHub, DevOps 및 개발 워크플로용 스킬입니다.

트랙 보기

시나리오

코딩 Agent

저장소를 이해하고 코드를 수정하며 Pull Request를 검토할 수 있는 코딩 Agent가 필요합니다.

Agent 적합도

Claude Code + OpenAI Agents + CLI

Codex, Claude Code, Cursor, CLI 또는 맞춤형 Agent에 적합합니다.

설치

준비됨

npx skills add samber/cc-skills-golang --skill golang-concurrency

유지보수

최신

마지막 푸시 후 2일

위험

안전하게 시도 가능

Quality score needs review

GitHub 품질

3.0K

82/100 품질 · 81/100 신뢰

커버리지 태그

코딩코딩 Agent코딩 Agentagent-skill

검토 메모

Quality score needs review

Agent 채택 스코어카드

신뢰, 감사, 설치 준비 상태를 한눈에 확인하세요

이 점수는 공개 저장소 메타데이터, OpenAgentSkill 검토 신호, 유지보수 최신성, 설치 준비 상태를 결합합니다. 후보 선정 신호일 뿐, 사람의 검토를 대체하지 않습니다.

품질

강함
82

프로덕션 워크플로 후보군에 넣을 만한 탄탄한 선택입니다.

신뢰

샌드박스 전용
73

신뢰 신호가 부족하거나 혼재된 유용한 후보입니다. 결과 루프가 작업 적합성을 입증할 때까지 격리된 작업 공간에서 사용하세요.

감사

안전하게 시도 가능
85

설치 준비 상태, 보안 메타데이터, 유지보수 및 채택 위험에 대한 기계 판독형 검토입니다.

OpenAgentSkill 신뢰 점수 v5

설치 전 사람 검토

실제 작업에 사용하기 전 샌드박스에서만 실행하고 유사 대안과 비교하세요.

CodexClaude CodeCursorOpenAgentSkill CLI

스타

GitHub 스타 3.0K

저장소 활동

스타 3.0K, 포크 197

유지보수

마지막 푸시 후 2일

라이선스

MIT

설치

npx skills add samber/cc-skills-golang --skill golang-concurrency

설치 안전성

표준 패키지 또는 런타임 설치 경로

권한 범위

shell or command execution, network or browser access

Agent 결과

아직 Agent 결과 데이터가 없습니다

문서

README/SKILL.md 맥락이 충분합니다

위험 요약

프로덕션 전 검토

  • Quality score needs review

설치 준비 상태

설치 경로 사용 가능

  • 설치 경로를 사용할 수 있습니다
  • 저장소 근거를 사용할 수 있습니다
  • 라이선스가 명시되었습니다
  • 아직 Agent 검증 결과 근거가 없습니다

Agent 읽기용 메타데이터

이 스킬의 기계 판독형 의사결정 데이터.

이 블록 또는 포함된 JSON을 사용해 Agent가 이 스킬을 설치할지, 대안을 고를지, 먼저 사람의 검토를 요청할지 판단할 수 있습니다.

JSON 열기

적합한 작업

  • 코딩 Agent 워크플로
  • Claude Code 팀
  • GitHub 채택 신호를 중시하는 팀
  • Inspect source files

적합한 Agent

CodexClaude CodeCursorOpenAgentSkill CLIOpenAI AgentsCLI

설치 결정

명령어
npx skills add samber/cc-skills-golang --skill golang-concurrency
정책
검토
사람 검토

신뢰와 위험

신뢰
73/100
감사
85/100
위험 수준
안전하게 시도 가능

결과 루프

엔드포인트
/api/agent/outcome
이벤트 ID
resolve
결과
5

설치 명령어

npx skills add samber/cc-skills-golang --skill golang-concurrency

사용하지 말아야 할 경우

  • 벤더 지원 SLA가 필요한 팀
  • 내부 보안 검토가 없는 고규정 준수 환경
  • 현재 메타데이터에서 주요 위험 신호가 발견되지 않았습니다
  • 고위험 권한 힌트: Shell 또는 명령 실행
  • Quality score needs review

Agent 안전 v2

61/100 · 설치 전 검토

권한 메모와 함께 검토됨검토

사용 가능한 후보이지만 Agent는 설치 전에 권한과 감사 메모를 표시해야 합니다.

실제 작업 공간에 설치하기 전에 사람의 승인이 필요합니다.

API로 해결

높음

Shell 또는 명령 실행

Skill 메타데이터가 터미널, CLI, Shell, 하위 프로세스 또는 명령 실행 워크플로를 참조합니다.

중간

네트워크 접근

Skill은 원격 페이지, API, 저장소 또는 외부 서비스에 접근할 수 있습니다.

  • 고위험 권한 힌트: Shell 또는 명령 실행
  • Quality score needs review

설치 대상

Agent 워크플로에 이 스킬 설치

공개 설치 엔드포인트에서 명령어, 안전 체크리스트, 대상 프롬프트와 정규 링크를 가져옵니다.

skill install

OpenAgentSkill CLI

Resolve policy, run the source installer safely, and report a verified install receipt.

$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install samber-golang-concurrency

Agent 해결 계획

설치 전에 Agent가 적합성을 검증하게 하세요.

Resolve API는 최우선 스킬, 대안, 안전 정책, 감사 메모, 설치 대상 및 Agent가 페이지를 스크래핑하지 않고 사용할 수 있는 프롬프트를 반환합니다.

텍스트 계획 열기

Agent가 확인할 항목

  • Resolve API에서 작업 적합도와 대안을 확인합니다.
  • 감사 점수, 신뢰 점수 및 안전 정책 경고를 확인합니다.
  • Codex, Claude Code, Cursor 또는 CLI의 설치 대상 호환성을 확인합니다.

프롬프트 복사

Task: Use golang-concurrency in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20golang-concurrency%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/samber-golang-concurrency/install
Install command: npx skills add samber/cc-skills-golang --skill golang-concurrency
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.

Agent 핸드오프

또 다른 디렉터리 페이지 대신 설치 경로를 Agent에게 제공합니다.

공개 설치 엔드포인트에서 명령어, 안전 체크리스트, 대상 프롬프트와 정규 링크를 가져옵니다.

설치 API 열기

Agent 프롬프트

Use golang-concurrency for this task. Review https://www.openagentskill.com/api/skills/samber-golang-concurrency/install, then install with: npx skills add samber/cc-skills-golang --skill golang-concurrency

Registry 메타데이터

자동 스킬 선택을 위한 Agent 읽기용 프로필.

Registry API를 통해 동일한 결정, 신뢰, 감사, 사용 사례, 설치 신호를 제공하므로 Agent가 UI를 스크래핑하지 않고도 순위를 매길 수 있습니다.

Manifest 열기

Agent 적합도

95/100

코딩 Agent

플랫폼

Claude Code, OpenAI Agents

감사 보고서

안전하게 시도 가능 · 85/100

설치 준비 상태, 보안 메타데이터, 유지보수 및 채택 위험에 대한 기계 판독형 검토입니다.

감사 보고서 보기평가 보고서 보기

Agent 결정 패널

코딩 Agent용 우선 추천

우선 후보로 사용하되, 자신의 Agent 환경에서 README와 설치 경로를 검증하세요.

95
준비 상태
채택
단계

스택 내 역할

우선 추천

주요 적합도

코딩 Agent

신뢰 라벨

프로덕션 준비 완료

설치 경로

명령어 준비됨

사용 시점

  • 코딩 Agent 워크플로
  • Claude Code 팀
  • GitHub 채택 신호를 중시하는 팀

근거

  • GitHub 스타 3,010
  • 최근 저장소 활동
  • 설치 명령 또는 GitHub 저장소를 사용할 수 있습니다
  • 품질 프로필 82/100
  • OpenAgentSkill 상호작용 6건

먼저 검토

  • 현재 메타데이터에서 주요 위험 신호가 발견되지 않았습니다

구현 경로

  1. 1샌드박스 Agent에 설치하고 코딩 Agent 작업을 처음부터 끝까지 한 번 실행하세요.
  2. 2Compare output quality, latency, and failure behavior against at least one alternative.
  3. 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.

신뢰 프로필

샌드박스 전용

신뢰 신호가 부족하거나 혼재된 유용한 후보입니다. 결과 루프가 작업 적합성을 입증할 때까지 격리된 작업 공간에서 사용하세요.

73
OpenAgentSkill 신뢰 점수

GitHub 채택도

통과

GitHub 스타 3.0K

스타/포크 활동

정보

스타 3.0K, 포크 197; 현재 메타데이터에서 이슈 활동을 확인할 수 없습니다

최근 유지보수

통과

마지막 푸시 후 2일

라이선스 명확성

통과

MIT

긍정 신호

  • AI 검토 승인됨
  • 설치 경로를 사용할 수 있습니다
  • 저장소 근거를 사용할 수 있습니다
  • 최근 유지보수된 저장소
  • 의미 있는 GitHub 채택 신호
  • 설치 명령에서 뚜렷한 고위험 패턴이 발견되지 않았습니다
  • 결과 루프는 준비되었지만 첫 실제 Agent 실행이 필요합니다

설치 전 검토

  • Quality score needs review
  • 아직 실제 Agent 결과 보고서가 없습니다
  • 무인 설치 전에 사람 검토가 필요합니다

권장 작업

실제 작업에 사용하기 전 샌드박스에서만 실행하고 유사 대안과 비교하세요.

품질 프로필

강함 Agent 워크플로용 후보

프로덕션 워크플로 후보군에 넣을 만한 탄탄한 선택입니다.

82
GitHub 스타
3.0K
최신성
2일 전
설치 준비됨
라이선스
MIT

워크플로 적합도

이 스킬을 사용할 시나리오

워크플로 적합도

완전한 워크플로에 추가

대안 후보

설치 전 비교

이 작업에 적합할 수 있는 유사 스킬입니다.

모두 비교

개요

--- name: golang-concurrency description: "Golang concurrency patterns. Use when writing or reviewing concurrent Go code involving goroutines, channels, select, locks, sync primitives, errgroup, singleflight, worker pools, or fan-out/fan-in pipelines. Also triggers when you detect goroutine leaks, race conditions, channel ownership issues, or need to choose between channels and mutexes." user-invocable: true license: MIT compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.0" openclaw: emoji: "⚡" homepage: https://github.com/samber/cc-skills-golang requires: bins: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion paths: - "**/*.go" ---

**Persona:** You are a Go concurrency engineer. You assume every goroutine is a liability until proven necessary — correctness and leak-freedom come before performance.

**Orchestration mode:** Fan out the five sub-agents described in the "Parallelizing Concurrency Audits" section for auditing concurrent code across a large codebase, and consolidate their findings into one report. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.

**Modes:**

- **Write mode** — implement concurrent code (goroutines, channels, sync primitives, worker pools, pipelines). Follow the sequential instructions below. - **Review mode** — reviewing a PR's concurrent code changes. Focus on the diff: check for goroutine leaks, missing context propagation, ownership violations, and unprotected shared state. Sequential. - **Audit mode** — auditing existing concurrent code across a codebase. Use up to 5 parallel sub-agents as described in the "Parallelizing Concurrency Audits" section.

> **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-concurrency` skill takes precedence.

# Go Concurrency Best Practices

Go's concurrency model is built on goroutines and channels. Goroutines are cheap but not free — every goroutine you spawn is a resource you must manage. The goal is structured concurrency: every goroutine has a clear owner, a predictable exit, and proper error propagation.

## Core Principles

1. **Every goroutine must have a clear exit** — without a shutdown mechanism (context, done channel, WaitGroup), they leak and accumulate until the process crashes 2. **Share memory by communicating** — channels transfer ownership explicitly; mutexes protect shared state but make ownership implicit 3. **Send copies, not pointers** on channels — sending pointers creates invisible shared memory, defeating the purpose of channels 4. **Only the sender closes a channel** — closing from the receiver side panics if the sender writes after close 5. **Specify channel direction** (`chan<-`, `<-chan`) — the compiler prevents misuse at build time 6. **Default to unbuffered channels** — larger buffers mask backpressure; use them only with measured justification 7. **Always include `ctx.Done()` in select** — without it, goroutines leak after caller cancellation 8. **Avoid repeated `time.After` in hot loops** — each call allocates a timer and creates unnecessary churn; use `time.NewTimer` + `Reset` for long-running loops 9. **Track goroutine leaks in tests** with `go.uber.org/goleak`

For detailed channel/select code examples, see [Channels and Select Patterns](references/channels-and-select.md).

## Channel vs Mutex vs Atomic

| Scenario | Use | Why | | --- | --- | --- | | Passing data between goroutines | Channel | Communicates ownership transfer | | Coordinating goroutine lifecycle | Channel + context | Clean shutdown with select | | Protecting shared struct fields | `sync.Mutex` / `sync.RWMutex` | Simple critical sections | | Simple counters, flags | `sync/atomic` | Lock-free, lower overhead | | Many readers, few writers on a map | `sync.Map` | Optimized for read-heavy workloads. **Concurrent map read/write causes a hard crash** | | Caching expensive computations | `sync.Once` / `singleflight` | Execute once or deduplicate |

## WaitGroup vs errgroup

| Need | Use | Why | | --- | --- | --- | | Wait for goroutines, errors not needed | `sync.WaitGroup` | Fire-and-forget | | Wait + collect first error | `errgroup.Group` | Error propagation | | Wait + cancel siblings on first error | `errgroup.WithContext` | Context cancellation on error | | Wait + limit concurrency | `errgroup.SetLimit(n)` | Built-in worker pool |

## Sync Primitives Quick Reference

| Primitive | Use case | Key notes | | --- | --- | --- | | `sync.Mutex` | Protect shared state | Keep critical sections short; never hold across I/O | | `sync.RWMutex` | Many readers, few writers | Never upgrade RLock to Lock (deadlock) | | `sync/atomic` | Simple counters, flags | Prefer typed atomics (Go 1.19+): `atomic.Int64`, `atomic.Bool` | | `sync.Map` | Concurrent map, read-heavy | No explicit locking; use `RWMutex`+map when writes dominate | | `sync.Pool` | Reuse temporary objects | Always `Reset()` before `Put()`; reduces GC pressure | | `sync.Once` | One-time initialization | Go 1.21+: `OnceFunc`, `OnceValue`, `OnceValues` | | `sync.WaitGroup` | Waiting for simple goroutines | Go 1.25+: prefer `wg.Go(func(){ ... })` for fire-and-wait tasks that do not panic and do not need error propagation. For Go <1.25 use `Add`/`Done`. For errors/cancellation/limits, use `errgroup` with context. | | `x/sync/singleflight` | Deduplicate concurrent calls | Cache stampede prevention | | `x/sync/errgroup` | Goroutine group + errors | `SetLimit(n)` replaces hand-rolled worker pools |

For detailed examples and anti-patterns, see [Sync Primitives Deep Dive](references/sync-primitives.md).

## Concurrency Checklist

Before spawning a goroutine, answer:

- [ ] **How will it exit?** — context cancellation, channel close, or explicit signal - [ ] **Can I signal it to stop?** — pass `context.Context` or done channel - [ ] **Can I wait for it?** — `sync.WaitGroup` or `errgroup` - [ ] **Who owns the channels?** — creator/sender owns and closes - [ ] **Should this be synchronous instead?** — don't add concurrency without measured need

## Pipelines and Worker Pools

For pipeline patterns (fan-out/fan-in, bounded workers, generator chains, Go 1.23+ iterators, `samber/ro`), see [Pipelines and Worker Pools](references/pipelines.md).

## Parallelizing Concurrency Audits

When auditing concurrency across a large codebase, use up to 5 parallel sub-agents:

1. Find all goroutine spawns (`go func`, `go method`) and verify shutdown mechanisms 2. Search for mutable globals and shared state without synchronization 3. Audit channel usage — ownership, direction, closure, buffer sizes 4. Find `time.After` in loops, missing `ctx.Done()` in select, unbounded spawning 5. Check mutex usage, `sync.Map`, atomics, and thread-safety documentation

## Common Mistakes

| Mistake | Fix | | --- | --- | | Fire-and-forget goroutine | Provide stop mechanism (context, done channel) | | Closing channel from receiver | Only the sender closes | | `time.After` in hot loop | Reuse `time.NewTimer` + `Reset` | | Missing `ctx.Done()` in select | Always select on context to allow cancellation | | Unbounded goroutine spawning | Use `errgroup.SetLimit(n)` or semaphore | | Sharing pointer via channel | Send copies or immutable values | | `wg.Add` inside goroutine | Call `Add` before `go` — `Wait` may return early otherwise | | Forgetting `-race` in CI | Always run `go test -race ./...` | | Mutex held across I/O | Keep critical sections short |

## Cross-References

- -> See `samber/cc-skills-golang@golang-performance` skill for false sharing, cache-line padding, `sync.Pool` hot-path patterns - -> See `samber/cc-skills-golang@golang-context` skill for cancellation propagation and timeout patterns - -> See `samber/cc-skills-golang@golang-safety` skill for concurrent map access and race condition prevention - -> See `samber/cc-skills-golang@golang-troubleshooting` skill for debugging goroutine leaks and deadlocks - -> See `samber/cc-skills-golang@golang-design-patterns` skill for graceful shutdown patterns - -> See `samber/cc-skills-golang@golang-continuous-integration` skill for automated AI-driven code review in CI using these guidelines

### Go 1.26 experimental goroutine leak profile

For Go 1.26 diagnostics, there is an experimental goroutine leak profile. It is useful for production-oriented leak investigation, but is gated by `GOEXPERIMENT=goroutineleakprofile`; do not rely on it as default stable behavior.

Typical usage when the experiment is enabled:

```bash curl http://localhost:6060/debug/pprof/goroutineleak?debug=2 go tool pprof http://localhost:6060/debug/pprof/goroutineleak ```

Keep existing tools:

- tests: `go.uber.org/goleak` - runtime count: `runtime.NumGoroutine()` - stack dump: `/debug/pprof/goroutine?debug=2` - race checks: `go test -race ./...`

## References

- [Go Concurrency Patterns: Pipelines](https://go.dev/blog/pipelines) - [Effective Go: Concurrency](https://go.dev/doc/effective_go#concurrency)

기술 세부 사항

버전
1.0.0
라이선스
MIT
최근 업데이트
2026년 8월 20일
게시일
2026년 8월 20일

결정 스냅샷

우선 추천

95
준비됨
채택
단계

GitHub 스타 3,010

감사

설치 검토

설치 및 채택 검토

85
안전하게 시도 가능
보안
83/100
유지보수
100/100
설치
92/100
전체 감사 열기평가 보고서 보기

Agent 검증 증거

Agent 검증 증거

Resolve, 검토, 설치 및 한 번의 제한된 실행 후 결과 보고서입니다.

0
검증됨
Needs first agent run자동 설치: 먼저 검토최근: 알 수 없음
성공률
최근 실패
결과
0
출력 품질
실패
0
관련 없음
0
설치
0
위험 차단
0
설정 필요
0
프로덕션
0

아직 Agent 결과 데이터가 없습니다. 첫 실행은 /api/agent/outcome을 통해 성공, 설정 필요, 위험 차단, 실패 또는 비관련 결과를 보고할 수 있습니다.

설치

Agent 워크플로에 추가

무료 오픈 소스. 프로덕션 Agent에 설치하기 전에 보고서를 검토하세요.

성장 루프

공유 키트

X

golang-concurrency용 시나리오 기반 초안입니다. X에 수동으로 게시할 수 있습니다.

큐레이터 노트
golang-concurrency: Golang concurrency patterns. Use when writing or reviewing concurrent Go code involving gorou...

3.0K stars

https://www.openagentskill.com/skills/samber-golang-concurrency?ref=x
X 초안 열기
선택 사항: 설치 명령이 포함된 답글
Listing + install path for golang-concurrency:
https://www.openagentskill.com/skills/samber-golang-concurrency?ref=x

Install: npx skills add samber/cc-skills-golang --skill golang-concurrency

등록 출처

Registry 색인

소유권 주장 가능

이 등록은 공개 소스에서 색인되었으며 유지보수자 소유권 주장이 승인될 때까지 공식으로 표시되지 않습니다.

제작자
samber
색인 주체
OpenAgentSkill 커뮤니티 인덱스

귀속은 공개 저장소 또는 제작자 프로필에 연결됩니다. 제작자는 등록을 주장하여 소유권 신호를 업데이트할 수 있습니다.

이 스킬 소유권 주장

소유자 소유권 주장

이 스킬 등록 소유권 주장

이 Registry 색인 등록은 samber에게 귀속되어 있지만 아직 공식으로 표시되지 않았습니다. 소유권을 주장하면 확인된 소유자 신호가 추가되어 이후 출시, 설치 및 감사 업데이트를 더 신뢰할 수 있습니다.

크리에이터 백링크 키트

README에 증거 배지 추가

개발자가 저장소를 평가하는 위치에 정규 등록, 현재 신뢰 및 감사 신호, 실제 Agent-Proven 증거를 표시합니다.

[![Listed on OpenAgentSkill](https://www.openagentskill.com/api/badge/samber-golang-concurrency?metric=listed&label=Listed)](https://www.openagentskill.com/skills/samber-golang-concurrency)
[![OpenAgentSkill Trust](https://www.openagentskill.com/api/badge/samber-golang-concurrency?metric=trust&label=Trust)](https://www.openagentskill.com/skills/samber-golang-concurrency)
[![OpenAgentSkill Audit](https://www.openagentskill.com/api/badge/samber-golang-concurrency?metric=audit&label=Audit)](https://www.openagentskill.com/skills/samber-golang-concurrency/audit)
[![Agent Proven](https://www.openagentskill.com/api/badge/samber-golang-concurrency?metric=proven&label=Agent%20Proven)](https://www.openagentskill.com/skills/samber-golang-concurrency)

작성자

S

samber

@samber

플랫폼 적합도

상태 신호

GitHub 스타
3.0K
품질 점수
48/100
최근 GitHub 푸시
2026년 8월 20일
프레임워크 힌트
알 수 없음
OpenAgentSkill 조회수
6
설치 명령 복사
0
외부 클릭
0

커뮤니티 신호

이 스킬이 Agent 워크플로에 유용한지 알려 주세요. 집계된 피드백은 시간이 지날수록 순위를 개선합니다.

신뢰와 안전

샌드박스 전용

73
  • GitHub 채택도GitHub 스타 3.0K통과
  • 스타/포크 활동스타 3.0K, 포크 197; 현재 메타데이터에서 이슈 활동을 확인할 수 없습니다정보
  • 최근 유지보수마지막 푸시 후 2일통과
  • 라이선스 명확성MIT통과
  • README/SKILL.md 완성도메타데이터에 충분한 사용 및 워크플로 맥락이 포함되어 있습니다통과
  • 의존성/런타임 위험command execution surface, network or browser surface정보