go-concurrency

go-concurrency is a skill for Claude Code, Codex from inference-gateway/adk. It costs 116 tokens per session (2,398 once invoked), scanned A, a copy of go-concurrency, Apache-2.0.

A guide to concurrency in Go, meaning programs doing multiple tasks at the same time. It covers goroutines, channels, locks, cancellation, and common ways to coordinate work.

In plain words
What is it for?
Use it when writing or reviewing Go code that shares state, starts goroutines, streams data, cancels work, or uses worker pools and pipelines.
Why use it?
Concurrent code can fail through races, deadlocks, or incorrect channel use. The guide helps choose the right coordination method and recommends checking code with Go’s race detector.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when writing or reviewing Go code that shares state, starts goroutines, streams data, cancels work, or uses worker pools and pipelines.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/inference-gateway/adk/go-concurrency
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add inference-gateway/adk --skill go-concurrency
Clone the repo
git clone --depth 1 https://github.com/inference-gateway/adk

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-concurrency

README.md
[![agentmods](https://agentmods.dev/badge/skills/inference-gateway/adk/go-concurrency/github.svg)](https://agentmods.dev/skills/inference-gateway/adk/go-concurrency)
Your own site
<a href="https://agentmods.dev/skills/inference-gateway/adk/go-concurrency"><img src="https://agentmods.dev/badge/skills/inference-gateway/adk/go-concurrency/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for go-concurrency

Your own site · 80×15
<a href="https://agentmods.dev/skills/inference-gateway/adk/go-concurrency"><img src="https://agentmods.dev/badge/skills/inference-gateway/adk/go-concurrency.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,398 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 92% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00116 $0.02398
Opus 5 $0.00058 $0.01199
Sonnet 5 $0.00023 $0.00480
Haiku 4.5 $0.00012 $0.00240

Measured 9d ago against content hash 70eb4d29487a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

go-concurrency scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

92% identical to go-concurrency — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/go-concurrency/SKILL.md · 277 lines

How it starts

The opening of the file, as written. The whole thing — 277 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Go Concurrency

A quick-reference for writing and reviewing concurrent Go. Reach for the table that fits the problem, copy the nearest pattern, then check it against the gotchas. Verify everything with go test -race.

Don't communicate by sharing memory; share memory by communicating. Use channels to pass ownership of data, distribute work, and signal. Use a mutex for in-place shared state (caches, counters, registries).

Pick your tool

Need Use
Hand off / stream values between goroutines chan
Protect shared state in place sync.Mutex / sync.RWMutex (read-heavy)
Wait for N goroutines to finish sync.WaitGroup
Run exactly once (lazy init) sync.Once
Reuse expensive allocations, cut GC pressure sync.Pool
Wake goroutines on a condition sync.Cond (rare; a channel is usually clearer)
Lock-free counters / flags sync/atomic
Cancellation, deadlines, request-scoped values context.Context

Always defer mu.Unlock() right after mu.Lock() so a panic can't leave the lock held.

In this repo: the streaming task path (StreamableTaskHandler, server/agent_streamable.go) is channel-based - RunWithStream returns a <-chan cloudevents.Event the caller ranges over. The producer owns and closes that channel; consumers only receive. The done-channel / context patterns below are exactly how a streaming handler should honor cancellation.

Channel states

Behaviour is defined by the operation × the channel's state. Memorize this:

Operation nil channel open channel closed channel
receive v := <-c blocks forever a value (or blocks if empty) zero value, ok==false (drains buffer first)
send c <- v blocks forever sends (or blocks if full) panic
close(c) panic closes it panic
  • Unbuffered (make(chan T)): send and receive rendezvous - each blocks until the other is ready. This is the synchronization.
  • Buffered (make(chan T, n)): send blocks only when full, receive only when empty. A buffer decouples timing; it does not remove backpressure.
  • Ownership rule: exactly one goroutine owns a channel - it creates, writes, and closes it, then hands consumers a receive-only <-chan T. This makes the panics above structurally impossible. Receivers never close.
  • range c reads until the channel is closed; v, ok := <-c detects closure.

Read the full file on GitHub · 277 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 277 lines · 116 tokens per session scan A 70eb4d29487a

Subscribe to this mod's changes

go-concurrency is a skill published in the GitHub repository inference-gateway/adk (25 stars, last pushed 5d ago), licensed Apache-2.0. It adds 116 tokens to every session and 2,398 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to go-concurrency, differing in 6 lines, and is treated as a copy.