golang-concurrency

Teach safe goroutine, channel, and synchronization patterns for Go services.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go concurrency often leads to leaks and race conditions; this Skill teaches safe, scalable patterns for goroutines, channels, and synchronization in Go.

Core Features & Use Cases

  • Structured concurrency guidance including context cancellation, WaitGroup, and errgroup for reliable lifecycle management
  • Correct use of channel direction, timers, and locking primitives to avoid leaks and data races
  • Practical patterns for pipelines, worker pools, and bounded concurrency across microservice boundaries

Quick Start

Start by scanning the included patterns to implement leak-free, context-aware concurrency in your Go projects.

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 microservice pipelines?

Prevent goroutine leaks by applying structured concurrency patterns with proper context cancellation and correct WaitGroup usage to manage goroutine lifecycles reliably in Go pipelines.

What is the best way to handle error propagation across concurrent Go workers?

Handle error propagation across concurrent Go workers using errgroup to synchronize goroutines and capture errors, ensuring safe and leak-free concurrent workload execution.

How does context cancellation work with Go channels and timers?

Context cancellation works with Go channels and timers by signaling goroutines to stop processing, preventing deadlocks and ensuring correct timer management for streaming workloads.

When do I need singleflight in Go concurrency patterns?

You need singleflight in Go concurrency patterns to suppress duplicate in-flight requests, preventing redundant computations and race conditions when multiple goroutines request the same resource.

Can I use channel direction and locking primitives to avoid data races in Go?

Use channel direction and locking primitives to enforce compile-time safety and avoid data races in Go, ensuring leak-free synchronization across bounded concurrency workers.