Challenge 3 — Solution Task: Write three functions that call each other: layerOne calls layerTwo, layerTwo calls layerThree, and layerThree returns a sentinel error ErrFailed. Each layer wraps the error with its own name using fmt.Errorf("...: %w", err). Print the final error from layerOne, then confirm errors.Is(err, ErrFailed) is still true despite 3 layers of wrapping. package main import ( "errors" "fmt" ) var ErrFailed = errors.New("operation failed") func layerThree() error { return ErrFailed } func layerTwo() error { err := layerThree() return fmt.Errorf("layerTwo: %w", err) } func layerOne() error { err := layerTwo() return fmt.Errorf("layerOne: %w", err) } func main() { err := layerOne() fmt.Println(err) fmt.Println(errors.Is(err, ErrFailed)) } Expected output: layerOne: layerTwo: operation failed true Notes: - The printed error message shows all 3 layers of context chained together: "layerOne: layerTwo: operation failed" — each %w wrap adds its own prefix while keeping everything underneath intact. - errors.Is(err, ErrFailed) still returns true because it unwraps through every %w layer (layerOne's wrap, then layerTwo's wrap) until it reaches the original ErrFailed sentinel and finds a match. - A direct comparison (err == ErrFailed) would return false here, since err's actual concrete value is the fully-wrapped error produced by layerOne, not ErrFailed itself.