go-async

Coordinate Go concurrency with errgroup, context propagation, and bounded worker pools.

1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/anicdh/agstack --skill go-async
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-async
Source: https://github.com/anicdh/agstack/tree/main/.claude/skills/go/go-async
Command: npx skills add https://github.com/anicdh/agstack --skill go-async

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinate safe, structured concurrency in Go to prevent leaks and ensure errors propagate correctly.

Core Features & Use Cases

  • Errgroup-based concurrency with error propagation and context awareness
  • Proper context propagation, timeouts, and graceful shutdown across workers
  • Worker pools and channel-based coordination for bounded concurrency
  • Clear patterns for avoiding goroutine leaks and race conditions in server and batch code

Quick Start

Demonstrate a minimal Go example using errgroup.WithContext to run five concurrent tasks with proper cancellation and error handling.

Frequently Asked Questions about go-async

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

FAQPage Schema
How do I prevent goroutine leaks during concurrent request handling in Go?

Prevent goroutine leaks by applying structured concurrency with errgroup.WithContext to ensure proper context propagation, explicit cancellation, and resource cleanup across workers.

What is the best way to propagate errors and context across multiple goroutines?

The best way to propagate errors across goroutines is using errgroup.WithContext, which automatically cancels the context when one worker returns an error, ensuring safe structured concurrency.

How do I implement bounded concurrency for parallel processing in Go?

Implement bounded concurrency for parallel processing by applying errgroup.SetLimit or channel-based worker pools to restrict active goroutines and prevent resource exhaustion.

Does errgroup work with context timeouts and graceful shutdown logic?

Yes, errgroup works seamlessly with context timeouts and graceful shutdown by propagating the context across workers, ensuring concurrent tasks cancel safely and clean up resources properly.

When should I use channel-based worker pools instead of errgroup.SetLimit?

Use channel-based worker pools instead of errgroup.SetLimit when you need explicit coordination logic for complex batch processing, rather than just bounding concurrency for parallel tasks.

Why does my Go concurrency code cause race conditions during parallel task execution?

Race conditions occur during parallel task execution without proper context propagation and bounded concurrency, which you can fix by applying structured concurrency patterns and explicit error handling.