I gave a talk at FOSDEM 2022 based on my post on using
errors.As. Here is the abstract:
Error handling is one of Go’s key features. The errors.As helper added in Go 1.13 gives Gophers the tools they need to build their own error domains and ensure that all errors are handled properly across their applications.
The errors.As feature of Go 1.13 makes it easy to create error systems that work for your particular applications, users, and operators without being straitjacketed by the language into a one-size-fits-all approach that inadvertently exposes users to the internal operations of your system. Don’t let your end users be distracted by irrelevant warning messages. Handle errors properly by thinking about their roles and domain within your application.