logoalt Hacker News

geoka906/04/20251 replyview on HN

Exactly; `return fmt.Errorf("annotation: %w", err)` is just a log-friendlier version of `return err`. The original wrapped error is meant for runtime inspection.


Replies

kiitos06/06/2025

The fmt.Errorf expr is wrapping the error, with relevant context at the wrap-site. It's not just "log-friendlier" it's actually important metadata.

show 1 reply