golang-concurrency

Detect and remediate Go concurrency issues in goroutines, channels, and sync primitives.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/Jylhis/claude-marketplace --skill golang-concurrency-jylhis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-concurrency
Source: https://github.com/Jylhis/claude-marketplace/tree/main/plugins/golang-dev/skills/golang-concurrency
Command: npx skills add https://github.com/Jylhis/claude-marketplace --skill golang-concurrency-jylhis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Helps engineers avoid and remediate concurrency bugs in Go by focusing on goroutine lifecycle, channel ownership, proper synchronization, and cancellation propagation to prevent leaks, races, and incorrect shared-memory usage.

Core Features & Use Cases

  • Guided Reviews: Evaluate PR diffs for goroutine leaks, missing context propagation, unsafe shared state, improper channel closure, and timer misuse.
  • Implementation Guidance: Provide patterns and code-level recommendations for building worker pools, pipelines, errgroup usage, singleflight, and correct sync primitive selection.
  • Audits at Scale: Run parallelized audits across a codebase to find goroutine spawns, channel ownership issues, and time.After misuse, with actionable remediation steps and references.
  • Reference-backed Advice: Includes detailed references on channels & select patterns, pipelines & worker pools, and sync primitive best practices to support recommendations.

Quick Start

Ask the skill to review the attached Go patch or repository for goroutine leaks, missing ctx cancellation, improper channel ownership, race conditions, and unsafe use of sync primitives.

Frequently Asked Questions about golang-concurrency

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

FAQPage Schema
How do I find goroutine leaks and missing context cancellation in Go code?

Detect goroutine leaks and missing context cancellation by reviewing Go patches for improper channel ownership, unsafe shared state, and timer misuse. Analyze goroutine spawns and channel pipelines to identify lifecycle bugs and ensure proper context propagation.

What is the best way to use errgroup and singleflight for Go concurrency control?

The best way to use errgroup and singleflight involves applying correct synchronization patterns like errgroup.SetLimit for worker pools and proper singleflight implementation. Enforce channel ownership rules and context cancellation to prevent races and ensure safe shared-memory access.

How do I review Go channel ownership and select patterns for race conditions?

Review Go channel ownership and select patterns by evaluating diffs for unsafe shared state, improper channel closure, and missing synchronization. Apply race detection techniques to channel-based pipelines and recommend appropriate mutex or atomic usage to remediate detected concurrency issues.

When should I use mutex vs atomic primitives in Go concurrent code?

Use mutex or atomic primitives in Go concurrent code based on specific synchronization needs identified during code review. Recommend atomic operations for simple state protection and mutexes for complex critical sections to prevent data races and ensure safe shared-memory access.

Can I run a parallelized audit across my Go repository for time.After misuse and channel issues?

Run parallelized audits across Go repositories to find goroutine spawns, channel ownership issues, and time.After misuse. Generate actionable remediation steps and reference-backed advice for detected concurrency bugs including leaks, races, and incorrect synchronization.