Mahib's Margins

Command Palette

Search for a command to run...

Design Patterns

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

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

  • September 5, 2023

    go
    Configuring options in Go

    Compare three Go option patterns: exposed structs, option constructors, and functional options. Learn when to use each for clean APIs.