GO LEARNING PATH · 11 LESSONS
Patterns: behavior
Eleven classic patterns, from Strategy and Command to State, Visitor and Interpreter.
Strategy: choose an algorithm explicitly
Pass interchangeable behavior through a function or small interface.
3 min · Worked lesson
Command: represent an action as a value
Make actions queueable or reversible without claiming every effect can be undone.
3 min · Worked lesson
Chain of Responsibility: ordered handlers
Stop or delegate deliberately and make short-circuit order visible.
3 min · Worked lesson
Iterator: yield values without exposing storage
Use iter.Seq or a small Next API and honor early termination.
3 min · Worked lesson
Mediator: centralize collaboration deliberately
Let participants communicate through a focused coordinator.
3 min · Worked lesson
Memento: retain a restorable snapshot
Let the owner define what a valid snapshot contains.
3 min · Worked lesson
Observer: subscribe, notify and unsubscribe
Keep notification lifetime and delivery semantics explicit.
3 min · Worked lesson
State: behavior follows a valid lifecycle
Represent legal transitions instead of scattered boolean combinations.
3 min · Worked lesson
Template Method: fixed workflow, supplied steps
Adapt the inheritance-based intent using composition in Go.
3 min · Worked lesson
Visitor: new operations over a stable set of nodes
Understand the tradeoff between adding node types and adding operations.
3 min · Worked lesson
Interpreter: evaluate a deliberately small language
Model a grammar without treating arbitrary text as executable code.
3 min · Worked lesson