Back to Skills

go-concurrency

verified

Go concurrency patterns - goroutines, channels, sync primitives

View on GitHub

Marketplace

pluginagentmarketplace-go

pluginagentmarketplace/custom-plugin-go

Plugin

go-development-assistant

Repository

pluginagentmarketplace/custom-plugin-go
3stars

skills/go-concurrency/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-go/blob/main/skills/go-concurrency/SKILL.md -a claude-code --skill go-concurrency

Installation paths:

Claude
.claude/skills/go-concurrency/
Powered by add-skill CLI

Instructions

# Go Concurrency Skill

Master Go concurrency patterns for safe, efficient parallel programming.

## Overview

Production-ready concurrency patterns including goroutines, channels, sync primitives, and common pitfalls to avoid.

## Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| pattern | string | yes | - | Pattern: "worker-pool", "fan-out", "pipeline", "semaphore" |
| workers | int | no | runtime.NumCPU() | Number of concurrent workers |
| buffer_size | int | no | 0 | Channel buffer size |

## Core Topics

### Goroutines with Context
```go
func ProcessItems(ctx context.Context, items []Item) error {
    g, ctx := errgroup.WithContext(ctx)

    for _, item := range items {
        item := item // capture loop variable
        g.Go(func() error {
            select {
            case <-ctx.Done():
                return ctx.Err()
            default:
                return process(item)
            }
        })
    }

    return g.Wait()
}
```

### Worker Pool
```go
func WorkerPool[T, R any](ctx context.Context, workers int, jobs <-chan T, fn func(T) R) <-chan R {
    results := make(chan R, workers)

    var wg sync.WaitGroup
    for i := 0; i < workers; i++ {
        wg.Add(1)
        go func() {
            defer wg.Done()
            for {
                select {
                case <-ctx.Done():
                    return
                case job, ok := <-jobs:
                    if !ok {
                        return
                    }
                    results <- fn(job)
                }
            }
        }()
    }

    go func() {
        wg.Wait()
        close(results)
    }()

    return results
}
```

### Rate Limiter
```go
type RateLimiter struct {
    tokens chan struct{}
}

func NewRateLimiter(rate int, interval time.Duration) *RateLimiter {
    rl := &RateLimiter{
        tokens: make(chan struct{}, rate),
    }

    go func() {
        ticker := time.NewTicker

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3538 chars