`error` is a built-in interface type in Go:
type error interface { Error() string }
Any type that implements `Error() string` can be used as an error.
type MyError struct{ Msg string } func (e MyError) Error() string { return e.Msg } func f() error { return MyError{Msg: "something went wrong"} }