Curriculum Errors & packaging errors.Is and errors.As exercise 7 · fill-line
errors.Is and errors.As
About this theme
Inspecting errors without breaking the wrap chain. errors.Is(err, target) walks the wrap chain looking for a match against a sentinel. errors.As(err, &target) walks looking for a type match, populating target if found. This is the modern, type-safe replacement for instanceof checks on errors.