{} The Go Reference

Interactive learning journey

Design Patterns, the Go way

Every classic Gang-of-Four pattern and Go's essential concurrency patterns — explained with clear diagrams, idiomatic Go you can run right here, and the exact places they hide in the standard library. Built to actually stick.

Your progress

Saved in your browser — mark a pattern “learned” on its page and watch the bars fill.

Skill map

Learned nodes light up — the glowing one is your next step. Click any node to jump in.

How this guide works

🧭

One pattern, one page

Every page follows the same rhythm: analogy → problem → diagram → idiomatic Go → trade-offs → quiz.

📊

See it, then read it

UML structure and sequence diagrams make the relationships obvious before you read a line of code.

🐹

Go-first, not translated

How interfaces, composition and goroutines reshape each classic pattern — and where the stdlib uses it.

🧠

Made to remember

Runnable code, a quiz on every page, and progress tracking turn passive reading into a journey you finish.

🚀 New here? Start with the Foundations

Five minutes on what patterns are and why Go does them differently makes every page that follows click into place. Then work top-to-bottom, or jump to whatever you need.

Start here

START · Start here Foundations: Patterns & the Go Mindset

What design patterns are, why they exist, and why they look so different in Go than in Java or C++.

Read first · ⏱ 5 min

Creational

How objects get made — controlling instantiation so the rest of your code never cares about concrete types.

Structural

How objects are composed — assembling types into larger structures while keeping them flexible.

Behavioral

How objects collaborate — assigning responsibilities and managing the flow of communication.

14 · Intermediate Chain of Responsibility

Pass a request along a chain of handlers until one of them handles it, decoupling sender from receiver.

✦ Complete · ⏱ 4 min
15 · Intermediate Command

Turn a request into a standalone object, letting you parameterize, queue, log, and undo operations.

✦ Complete · ⏱ 3 min
16 · Advanced Interpreter

Define a grammar for a simple language and an interpreter that evaluates sentences by walking an expression tree.

✦ Complete · ⏱ 4 min
17 · Beginner Iterator

Provide a way to access the elements of a collection sequentially without exposing its underlying representation.

✦ Complete · ⏱ 4 min
18 · Intermediate Mediator

Centralize communication between objects in a mediator, so they don't refer to each other directly.

✦ Complete · ⏱ 3 min
19 · Intermediate Memento

Capture and externalize an object's internal state so it can be restored later — without violating its encapsulation.

✦ Complete · ⏱ 3 min
20 · Intermediate Observer

Define a one-to-many dependency so that when one object changes state, all its dependents are notified automatically.

✦ Complete · ⏱ 5 min
21 · Intermediate State

Let an object alter its behavior when its internal state changes, as if it changed class.

✦ Complete · ⏱ 4 min
22 · Beginner Strategy

Define a family of interchangeable algorithms, encapsulate each one, and select which to use at runtime.

✦ Complete · ⏱ 5 min
23 · Intermediate Template Method

Define the skeleton of an algorithm once, deferring the steps that vary to per-type implementations.

✦ Complete · ⏱ 4 min
24 · Advanced Visitor

Add new operations to a set of object types without modifying those types, by moving each operation into a visitor.

✦ Complete · ⏱ 4 min

Go Concurrency Patterns

The patterns that make Go special — goroutines and channels composed into pipelines, pools and safe cancellation.

Go & the standard library

GUIDE · Reference Patterns in the Go Standard Library

A tour of the classic design patterns hiding in plain sight across Go's standard library.

Tour · ⏱ 4 min
PRACTICE · Reference Patterns Cheat-Sheet

A one-page map of every pattern — its intent, the idiomatic Go form, and when to reach for it. Built for revision and interview prep.

Revise · ⏱ 4 min

🐹 A note on Go and patterns

Many “patterns” are really workarounds for things Java and C++ make hard. Go's interfaces, struct embedding, first-class functions and goroutines dissolve some of them and reshape the rest. Throughout this guide we call out when a pattern becomes a one-liner in Go — and when it's still genuinely useful.