golang-concurrency

Enforce structured Go concurrency patterns with context cancellation and safe channel usage.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/nrmnqdds/gomaluum --skill golang-concurrency-nrmnqdds
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-concurrency
Source: https://github.com/nrmnqdds/gomaluum/tree/main/.agents/skills/golang-concurrency
Command: npx skills add https://github.com/nrmnqdds/gomaluum --skill golang-concurrency-nrmnqdds

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go concurrency can be error-prone due to leaks, race conditions, and complex lifecycle management. This Skill provides structured guidance and patterns to write, review, and audit concurrent Go code safely.

Core Features & Use Cases

  • Enforces context-aware goroutines, proper cancellation, and clean shutdown
  • Covers channel direction, worker pools, pipelines, and common anti-patterns
  • Useful for code reviews, PR audits, and implementing robust concurrent components in services, servers, and CLIs

Quick Start

Provide a safe, ready-to-run Go concurrency pattern for a given task using the skill's best practices.

Frequently Asked Questions about golang-concurrency

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

FAQPage Schema
How do I prevent goroutine leaks in Go concurrent services?

Prevent goroutine leaks by enforcing context cancellation and clear goroutine lifecycles. Structured concurrency patterns ensure goroutines properly observe context done signals and terminate gracefully during service shutdown.

What is the best way to implement bounded concurrency with errgroup in Go?

Implement bounded concurrency using errgroup.SetLimit to restrict parallel goroutine execution. This pattern prevents resource exhaustion by limiting active workers while propagating context cancellation and collecting errors efficiently.

How do I build a safe worker pool pipeline using Go channels?

Build safe worker pool pipelines by applying channel direction restrictions and proper shutdown sequences. Clear channel ownership and context propagation prevent race conditions and ensure pipeline stages terminate cleanly.

When should I use sync.Pool and singleflight for concurrent Go resource management?

Use sync.Pool and singleflight for safe resource reuse and deduplication in concurrent Go programs. sync.Pool manages reusable allocations while singleflight prevents duplicate concurrent computations.

Does this Go concurrency guidance apply to CLI tools and servers?

Yes, this concurrency guidance applies to Go services, servers, and CLI tools relying on concurrent work. It audits existing code, reviews PRs, and implements robust worker pools and parallel tasks.