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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs