
Series
golang-design-patterns
Discover more

Interpreter parses a small order string like "L:latte+milk+sugar" into a structured drink object using a simple grammar.

Visitor lets a coffee shop run different operations — tax, discount, calories — over the same menu items without modifying the item classes themselves.

Mediator centralizes communication between a coffee shop's barista, cashier, and kitchen so they no longer need to reference each other directly.

Memento captures and restores an order's state, giving a coffee shop's order flow an undo button without breaking encapsulation.