Módulo 15 · Design Patterns in Go — Lección 1 de 8 · ~8 min
Functional Options
The most Go pattern there is
You've built the PawWalk server. Now the interview module: the design patterns a Go reviewer actually looks for. We lead with the one that has no equivalent in the Gang-of-Four book because it's pure Go — Functional Options.
The problem: your Server has a dozen knobs — port, timeout, TLS, logger. A constructor New(port, timeout, tls, logger, ...) is a wall of positional arguments where nobody remembers the order, and every new knob breaks every caller. Go has no default arguments and no named parameters to fall back on.