Skip to content
Opensource internals
  • Posts

Idiomatic go

Go's Error Wrapping: %w, errors.Is and a Tree of Causes

Oct 21, 2026 19 min read Jay Hubbert

Wrapping is two optional methods, Unwrap and Is; fmt.Errorf with %w builds a *wrapError, errors.Is and errors.As walk the resulting tree, and errors.Join turns it into a branching …

GoInternalsErrorsIdiomatic goStdlib

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·