Skip to content

Glossary: Go Basics

errors.Is and errors.As

Also written: errors.Is, errors.As

`errors.Is` asks whether an error is (or wraps) a particular error value, such as `ErrNotFound`. `errors.As` asks whether it is of a particular type and, if so, fills a variable so you can read its fields.

Where the book teaches it

Related terms

ErrNotFound