goroutine-leak-prevention

Detect goroutine leaks and race-condition risks in Go SDK code.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/PremModhaOfficial/go-sdk-pipeline --skill goroutine-leak-prevention
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: goroutine-leak-prevention
Source: https://github.com/PremModhaOfficial/go-sdk-pipeline/tree/main/.claude/skills/goroutine-leak-prevention
Command: npx skills add https://github.com/PremModhaOfficial/go-sdk-pipeline --skill goroutine-leak-prevention

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Goleak patterns, race-condition hygiene, and ctx-cancelled goroutine exits are a source of subtle bugs in Go SDKs. This skill helps teams identify and prevent leaks and ensures clean shutdown paths.

Core Features & Use Cases

  • Detect common goleak patterns and race-hygiene gaps in Go SDK modules.
  • Enforce proper context cancellation and graceful goroutine termination.
  • Use during design and reviews to prevent leaks in long-running services and concurrent workflows.

Quick Start

Audit a Go module for goroutine leaks and run the sdk-leak-hunter to verify safe cancellation of all goroutines.

Frequently Asked Questions about goroutine-leak-prevention

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

FAQPage Schema
How do I detect goroutine leaks in a Go SDK?

Detect goroutine leaks in a Go SDK by auditing modules for common goleak patterns and race-hygiene gaps, then running the sdk-leak-hunter tool to verify safe cancellation of all goroutines.

How do I enforce context cancellation for long-running goroutines in Go?

Enforce context cancellation for long-running goroutines in Go by applying proper context propagation and graceful termination patterns to ensure clean shutdown paths across concurrent workflows.

What causes goroutine leaks in Go concurrent workflows?

Goroutine leaks in Go concurrent workflows are caused by missing context cancellation, blocked channel sends, and race-condition hygiene gaps that prevent long-running tasks from exiting cleanly.

Can I use the race detector to find goroutine leaks in Go modules?

Use the Go race detector alongside goleak pattern analysis to identify race-condition risks and verify proper context cancellation across packages introducing concurrent work.

When should I audit Go SDK modules for goroutine leaks?

Audit Go SDK modules for goroutine leaks during design and code reviews when updates introduce concurrent work, long-running tasks, or new context cancellation patterns across packages.