Mahib's Margins

Command Palette

Search for a command to run...

Concurrency

  • July 25, 2026

    go
    Supervised fire-and-forget in Go

    A bounded worker pool for small background tasks, with task-owned contexts, panic recovery, and graceful shutdown.

  • February 24, 2026

    go
    What canceled my Go context?

    How Go 1.20's WithCancelCause and Go 1.21's WithTimeoutCause let you attach a reason to context cancellation, plus a gotcha with manual cancel and the stdlib pattern that covers every path.

  • September 7, 2025

    go
    Early return and goroutine leak

    Prevent goroutine leaks caused by early returns with unbuffered channels. Learn buffering, draining, errgroup patterns, and goleak testing.

  • August 23, 2023

    go
    Limit goroutines with buffered channels

    Control goroutine concurrency with buffered channels as semaphores. Prevent resource exhaustion with backpressure patterns in Go workers.