errors package
Canonical docs for sentinels, wrapping, joining, and error inspection via `errors.Is` and `errors.As`.
Canonical docs for sentinels, wrapping, joining, and error inspection via errors.Is and errors.As.
- Author: Go Team
- Authority: primary
- Kind: package-doc
- URL: https://pkg.go.dev/errors
What it covers
- error wrapping and unwrapping
- sentinel and typed error inspection
- joined errors and traversal
Why authoritative
Official package documentation for Go’s core error inspection and wrapping APIs.
Use when
- how should I compare errors in Go
- when should I use errors.Is or errors.As
- what does the errors package support here
Keywords
- errors package, errors.Is, errors.As, errors.Join, wrapping