Smithery Logo
MCPsSkillsDocsPricing
Login
Smithery Logo

Accelerating the Agent Economy

Resources

DocumentationPrivacy PolicySystem Status

Company

PricingAboutBlog

Connect

© 2026 Smithery. All rights reserved.

    spjoshis

    go-concurrency

    spjoshis/go-concurrency
    Coding
    1
    1 installs

    About

    SKILL.md

    Install

    Install via Skills CLI

    or add to your agent
    • Claude Code
      Claude Code
    • Codex
      Codex
    • OpenClaw
      OpenClaw
    • Cursor
      Cursor
    • Amp
      Amp
    • GitHub Copilot
      GitHub Copilot
    • Gemini CLI
      Gemini CLI
    • Kilo Code
      Kilo Code
    • Junie
      Junie
    • Replit
      Replit
    • Windsurf
      Windsurf
    • Cline
      Cline
    • Continue
      Continue
    • OpenCode
      OpenCode
    • OpenHands
      OpenHands
    • Roo Code
      Roo Code
    • Augment
      Augment
    • Goose
      Goose
    • Trae
      Trae
    • Zencoder
      Zencoder
    • Antigravity
      Antigravity
    ├─
    ├─
    └─

    About

    Master Go concurrency with goroutines, channels, select, sync primitives, and patterns for building concurrent applications.

    SKILL.md

    Go Concurrency Patterns

    Master Go's concurrency model with goroutines, channels, and synchronization for building efficient concurrent systems.

    Core Patterns

    Goroutines

    func main() {
        go sayHello() // Launch goroutine
    
        time.Sleep(1 * time.Second) // Wait for goroutine
    }
    
    func sayHello() {
        fmt.Println("Hello from goroutine")
    }
    

    Channels

    func main() {
        messages := make(chan string)
    
        go func() {
            messages <- "ping"
        }()
    
        msg := <-messages
        fmt.Println(msg)
    }
    

    Worker Pool

    func worker(id int, jobs <-chan int, results chan<- int) {
        for j := range jobs {
            fmt.Println("worker", id, "processing job", j)
            time.Sleep(time.Second)
            results <- j * 2
        }
    }
    
    func main() {
        jobs := make(chan int, 100)
        results := make(chan int, 100)
    
        // Start workers
        for w := 1; w <= 3; w++ {
            go worker(w, jobs, results)
        }
    
        // Send jobs
        for j := 1; j <= 5; j++ {
            jobs <- j
        }
        close(jobs)
    
        // Collect results
        for a := 1; a <= 5; a++ {
            <-results
        }
    }
    

    Select Statement

    select {
    case msg1 := <-channel1:
        fmt.Println("Received", msg1)
    case msg2 := <-channel2:
        fmt.Println("Received", msg2)
    case <-time.After(1 * time.Second):
        fmt.Println("Timeout")
    }
    

    Best Practices

    1. Don't communicate by sharing memory; share memory by communicating
    2. Close channels from sender side
    3. Use buffered channels wisely
    4. Handle goroutine cleanup
    5. Use context for cancellation
    6. Avoid goroutine leaks

    Resources

    • https://go.dev/tour/concurrency/1
    • https://go.dev/blog/pipelines
    Recommended Servers
    Vercel Grep
    Vercel Grep
    Svelte
    Svelte
    Discord
    Discord
    Repository
    spjoshis/claude-code-plugins
    Files