Skip to content

Glossary: Go Beyond the Basics

errors.As

Searches an error and everything it wraps for an error of a given type, and fills your variable with it. Use it to read fields such as `StockError.Have`.

Where the book teaches it

Related terms

errors.Issentinel errorwrapping errors (%w)