golang-concurrency

Enforce safe Go concurrency patterns for goroutines, channels, and synchronization.

5|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/omarluq/og-template --skill golang-concurrency-omarluq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-concurrency
Source: https://github.com/omarluq/og-template/tree/main/.agents/skills/golang-concurrency
Command: npx skills add https://github.com/omarluq/og-template --skill golang-concurrency-omarluq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go concurrency can be tricky; this Skill codifies safe patterns to write correct, leak-free concurrent Go code.

Core Features & Use Cases

  • Provides lifecycle-aware goroutine patterns (context cancellation, done channels, and proper shutdown)
  • Promotes channel ownership discipline, direction, and safe closing
  • Offers guidance for pipelines, worker pools, and error propagation using modern primitives

Quick Start

Create a tiny concurrent workflow that uses context cancellation, a worker pool, and a clean shutdown.

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?

To prevent goroutine leaks in Go, apply lifecycle-aware patterns using context cancellation and done channels. Establishing clear channel close ownership ensures goroutines shut down cleanly and avoid blocking indefinitely.

What is the best way to handle race conditions in Go concurrent programs?

Handling race conditions in Go requires enforcing safe concurrency patterns with proper synchronization primitives. Using channel direction and ownership discipline structurally prevents data races across worker pools and pipelines.

How do I propagate errors in a Go worker pool?

Propagating errors in a Go worker pool involves using modern concurrency primitives for error handling alongside context usage. Establishing clear channel ownership ensures errors are safely transmitted without deadlocks.

When do I need context cancellation in Go goroutines?

You need context cancellation in Go goroutines when managing concurrent lifecycle tasks like worker pools and pipelines. It provides proper shutdown signals, preventing blocked goroutines and ensuring production-grade concurrent code.

Does this Skill cover channel direction and close ownership?

Yes, this Skill covers channel direction and close ownership. It codifies safe patterns for Go projects using goroutines and channels, enforcing discipline to produce leak-free concurrent code across typical tasks.