go-patterns
esc

Colophon

About this reference

The full 23-pattern Gang of Four catalog plus 8 agentic patterns, written for engineers who already know Go and want the tradeoffs, not the class diagram. Every example lives in a real module, uses the standard library only, and is executed with the race detector on every change.

source

Real Go, not pseudo-code

Every snippet is imported from src/code at build time. If it appears on the page, it compiles.

ci

gofmt, vet, staticcheck, race

Each example is run with the race detector in CI on every change. Standard library only — no third-party deps.

privacy

Local-first progress

Reading state and roadmap ticks live in IndexedDB on your device. No account, no sync, no tracking.

domain

One consistent domain

Orders, carts and catalogs across all 31 patterns, so you compare the pattern rather than re-learning the scenario.

Stack

Astro Static generation; JavaScript only ships where a component needs it.
MDX Pattern prose with real Go files imported via ?raw.
Shiki Build-time syntax highlighting — no client-side highlighter.
Mermaid.js The step-by-step architecture diagrams, with a narrator panel per node.
Tailwind CSS v4 Utility-first CSS over the custom properties that drive the dark and light themes.
Dexie / IndexedDB Reading progress and roadmap ticks, on-device.
Go 1.24 The examples' own module, verified in CI with the race detector.

What each pattern page includes

The Problem

A concrete scenario where the pattern is needed.

The Solution

How the pattern translates into Go.

Structure

A diagram that steps through the participants one at a time, with source view, copy and fullscreen.

Implementation

The complete Go files from src/code, as tabs.

Pros and Cons

The advantages, disadvantages and tradeoffs of the pattern.

When to Use / When NOT to Use

Practical guidance on applicability, plus links to related patterns.

How the patterns are organized