Error value
An error value is a value that represents a failure condition and can be returned or otherwise handled as data.
Go in Action, Second Edition
An error value is a Go value of the error type that reports whether an operation encountered a problem.
- How it is used
- Uses error values to make failures visible in function results and handle them close to the operation.
- How deep it goes
- Explains return conventions, nil checks, the error interface, and handling choices; defers detailed wrapping and panic recovery.
- Examples
- Illustrates errors with os.ReadFile, a key/value store interface, and logging followed by os.Exit.
- What you can do after
- Apply error checks to function calls and choose whether to return, log, retry, or explicitly ignore a failure.
Read how Go in Action, Second Edition explains error value →
Systems Programming with Zig
An error value is a value representing a failure condition that a Zig operation or function can return.
- How it is used
- Signals operation or function failure and makes handling part of valid code.
- How deep it goes
- Defines failure values and requires handling or explicit discard, while describing compiler checks over declared error sets.
- What you can do after
- Apply explicit error handling by handling or deliberately discarding errors and return values.
Read how Systems Programming with Zig explains error value →
Also covered in
Related concepts
- Goused by · Go is a statically typed, compiled, general-purpose programming language with garbage collection and built-in support for concurrency.
- functional error handlingimplements · Functional error handling represents failures as values that can be composed and propagated through functional operations, rather than relying solely on exceptions.
- os.ReadFileproduced by · os.ReadFile is a Go standard-library function that reads an entire named file and returns its contents as a byte slice and an error.
- functionproduced by · A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
Questions about error value
What is error value?
An error value is a value that represents a failure condition and can be returned or otherwise handled as data.
Which Manning books explain error value?
Go in Action, Second Edition and Systems Programming with Zig.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

