wshobson avatar

Go Concurrency Patterns

A solid collection of battle-tested Go concurrency patterns that covers the essentials: worker pools, fan-out/fan-in pipelines, semaphore-based rate limiting, and graceful shutdown handling. The code examples are production-ready and demonstrate proper context usage, channel management, and synchronization primitives. What I appreciate is the focus on real patterns you'll actually encounter, like bounded concurrency and proper goroutine lifecycle management. The graceful shutdown pattern alone is worth having on hand since most tutorials skip this crucial piece. Perfect reference when you need to implement concurrent processing or debug those inevitable race conditions that pop up in Go services.

skills.sh installs
11.7K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill go-concurrency-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Go Concurrency Patterns

Production patterns for Go concurrency including goroutines, channels, synchronization primitives, and context management.

When to Use This Skill

  • Building concurrent Go applications
  • Implementing worker pools and pipelines
  • Managing goroutine lifecycles
  • Using channels for communication
  • Debugging race conditions
  • Implementing graceful shutdown

Core Concepts

1. Go Concurrency Primitives

PrimitivePurpose
goroutineLightweight concurrent execution
channelCommunication between goroutines
selectMultiplex channel operations
sync.MutexMutual exclusion
sync.WaitGroupWait for goroutines to complete
context.ContextCancellation and deadlines

2. Go Concurrency Mantra

Don't communicate by sharing memory;
share memory by communicating.

Quick Start

package main

import (
    "context"
    "fmt"
    "sync"
    "time"
)

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
Backend & APIs, Debugging, Go

More from wshobson/agents

All 174
1earthtojake avatarurdfearthtojake/text-to-cadURDF robot description generation and default generation-time validation. Use when creating, editing, regenerating, inspecting, or debugging `.urdf` files, Pyth11.5Kskills.sh installs
2wshobson avatarincident-runbook-templateswshobson/agentsCreate structured incident response runbooks with step-by-step procedures, escalation paths, and recovery actions. Use this skill when building a service outage11.4Kskills.sh installs
3intellectronica avatarcontext7intellectronica/agent-skillsRetrieve up-to-date documentation for software libraries, frameworks, and components via the Context7 API. This skill should be used when looking up documentati11.3Kskills.sh installs
4getcargohq avatarcargo-workspace-managementgetcargohq/cargo-skillsManage workspace users, API tokens, folders, roles, and submit reports to workspace management using the Cargo CLI. Use when the user wants to invite or manage 11.2Kskills.sh installs
5shopify avatarshopify-polaris-app-homeshopify/shopify-ai-toolkitBuild your app's primary user interface embedded in the Shopify admin. If the prompt just mentions `Polaris` and you can't tell based off of the context what AP11Kskills.sh installs
6nomadamas avatarnaver-blog-researchnomadamas/k-skillSearch Naver blogs, read full post content, and download images using only python3 stdlib — no API key required.10.9Kskills.sh installs