go-concurrency-patterns

Provides concise Rust code examples for common data analysis tasks.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/bjaus/dotfiles --skill go-concurrency-patterns-bjaus
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: go-concurrency-patterns
Source: https://github.com/bjaus/dotfiles/tree/main/plugin/skills/go-concurrency-patterns
Command: npx skills add https://github.com/bjaus/dotfiles --skill go-concurrency-patterns-bjaus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps Go developers select and apply the most appropriate concurrency pattern instead of over- or under-using concurrency, improving correctness and performance.

Core Features & Use Cases

  • Pattern guidance: Recommend the most suitable Go concurrency pattern (e.g., errgroup, worker pool, fan-out/fan-in, mutex-based synchronization) based on task characteristics.
  • Safe-by-default templates: Provide minimal, idiomatic Go code sketches demonstrating the chosen pattern with cancellation and error handling.
  • Use Case Scenarios: From aggregating results of N tasks to streaming work items with fixed workers and graceful shutdown.

Quick Start

Ask: "For a scenario with N independent tasks that produce results, show an idiomatic Go snippet using errgroup to collect results with cancellation."

Frequently Asked Questions about go-concurrency-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to aggregate results from multiple goroutines in Go?▼

To aggregate results from multiple goroutines, use the errgroup pattern to collect outputs while enforcing cancellation and error handling. This skill provides safe-by-default templates to coordinate these concurrent tasks effectively.

How do I implement a worker pool in Go with fixed concurrency limits?▼

Implement a worker pool in Go with fixed concurrency by streaming work items through channels to a fixed number of workers. This skill provides idiomatic Go code sketches demonstrating this pattern with safe synchronization and graceful shutdown.

When should I use errgroup instead of a mutex for Go concurrency?▼

Use errgroup for managing multiple independent tasks requiring error propagation and cancellation, while a mutex protects shared memory. This skill identifies the most suitable Go concurrency pattern based on your specific task characteristics.

How do I handle graceful shutdown in a Go concurrent application?▼

Handle graceful shutdown in a Go concurrent application by coordinating context cancellation and proper channel management to stop workers safely. This skill enforces idiomatic practices for coordinating shutdown without leaving orphaned goroutines.

Does this provide safe-by-default Go code for fan-out/fan-in concurrency?▼

Yes, it provides safe-by-default Go code for fan-out/fan-in concurrency by offering minimal, idiomatic code sketches. These templates demonstrate proper channel management and context usage to prevent race conditions while distributing and collecting work.