Skip to Content
@michael-fridmanatvisioncri-d8458
Jan 29, 2019

Go 2 Error inspection

Maybe I'm bias, but one of my favorite "features" of Go is error handling.

One could argue that Go applications are stable due to a conscious result of having to think about all errors, everywhere, all the time. (unless you discard, but that'll be flagged in code reviews quickly 😉).

Back in ~2016 David Cheney released a super useful package (pkg/errors) and wrote about it (there is also a video):

Don’t just check errors, handle them gracefully

There were other packages, but this one worked really well and was simple.

So many folks adopted the "annotate, return and optionally inspect" pattern (I made this up, but that's the gist of it) that it only makes sense to have this functionality in the standard library.

Here were are, January 25, 2019. And a new proposal awaits us.

The GitHub discussion can be found here, and the proposal:

The language gets better as we continue contributing and sharing user experiences, discussing the pros and cons, etc.

Think about it, sleep on it, and whether you think it's 👍 or 👎 let's talk about it.

Gopher mascot designed by Renee French / CC 3.0. Check out the Go Blog.

@michael-fridmanatvisioncri-d8458

Join in on the conversation with Michael Fridman when you subscribe to Golang Toronto.