typeover
curriculum

Curriculum Errors & packaging The error pattern exercise 8 · freeform

The error pattern


About this theme

Go has no exceptions for ordinary control flow. Errors are values returned alongside results — (T, error). The caller checks err != nil and decides. This feels noisy at first; it becomes legible once you trust the convention. fmt.Errorf("... %w", err) wraps, preserving the inner error.