Why is my nil error value not equal to nil?
Concise FAQ entry explaining typed nil values stored in interfaces, especially `error`.
Concise FAQ entry explaining typed nil values stored in interfaces, especially error.
- Author: Go Team
- Authority: primary
- Kind: faq
- URL: https://go.dev/doc/faq#nil_error
What it covers
- nil error comparison
- typed nil in interfaces
- error-specific interface traps
Why authoritative
Official Go FAQ answer for one of the most common interface nil pitfalls.
Use when
- why is this nil error non-nil
- why does my error compare unequal to nil
- what is a typed nil error in Go
Keywords
- nil error, typed nil, error interface, faq, interface nil