errors - errors as values.
A function that can fail returns an error as its result, the caller checks it with failed():
if failed(n = strconv.ParseInt("x", 10)) {
return errors.Wrap(n, "parsing the port")
}
¶New = fn(msg)source
New builds an error with the given message.
¶Wrap = fn(err, msg)source
Wrap returns a new error adding context to err, keeping its message.
¶Is = fn(err, target)source
Is reports whether err is an error whose message contains target.
¶Message = fn(err)source
Message returns the text of err, or the empty string if err is not an error.