logo dotConferences
Menu

Rethinking Errors in Go

Marcel van Lohuizen at dotGo 2017

The Go team is starting to think about Go 2. Marcel addresses some of the current issues with handling errors in Go and introduces a burner package that addresses these issues by introducing a unified model of error, defer, and panic.

Although this package can simplify Go code today, he hopes that experience with this package can help us understand how error handling can be improved at the language level.

Slides

More details

There are two packages that implement the new error semantics.

Package errc is requires less changes to your code:

Package errd is less Go-like, but makes it harder to make errors and is a bit faster: