DEV Community

Jonathan Hall
Jonathan Hall

Posted on

1

What's the proper way to wrap errors in Go?

errors.New()? fmt.Errorf()? errors.Errorf()? errors.Wrapf()? Which should you use?

In this video, I dive into the history of the various ways to wrap errors in Go, and describe which method(s) you should be using now.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay