This chapter surveys several Go packages related to the Go runtime.
Errors Package
The errors package provides functions to help create and select errors. Many community extensions, some drop-in replacements, exist.
There is a built-in
error type. All errors implement this predefined
interface:
type error interface {
Error() string
}
This means any type that conforms to this interface (i.e., has the Error method) can be used as an error. This means many custom errors can be created. Many Go packages provide custom ...