Mahib's Margins

Command Palette

Search for a command to run...

Go

  • 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.

  • July 4, 2026

    go
    Modernizers & go fix

    Go 1.26 rebuilt go fix on the analysis framework. It modernizes your code and respects the Go version your module declares. The post covers the modernizers, the bigger x/tools suite, and what //go:fix inline can and can't migrate.

  • April 18, 2026

    go
    Peeking into Go struct tags

    A quick tour of Go struct tags: how different libraries use them, how you read them at runtime with reflection, and how other tools read them at build time instead.

  • 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.

  • November 1, 2025

    go
    Revisiting interface segregation in Go

    Apply SOLID's Interface Segregation Principle in Go with consumer-defined contracts. Learn why small interfaces and implicit implementation matter.

  • September 20, 2025

    go
    Let the domain guide your application structure

    Organize Go apps by domain, not technology. Learn why models/controllers structure hurts and how bounded contexts create better separation.

  • 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 3, 2025

    go
    Gateway pattern for external service calls

    Separate business logic from external service calls using the Gateway pattern. Apply dependency inversion and interface segregation in Go.

  • February 8, 2025

    go
    Why does Go's io.Reader have such a weird signature?

    Understand why io.Reader takes a byte slice parameter instead of returning one. Learn about heap allocations and buffer reuse in Go streams.

  • October 6, 2024

    go
    Writing a circuit breaker in Go

    Build a production-ready circuit breaker in Go from scratch with closed, open, and half-open states to prevent cascading failures.