Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorValue = errors.New("this is a typed error")
ErrorValue is a way to make a package level error to check against. I.e. if err == ErrorValue
Functions ¶
Types ¶
type CustomError ¶
type CustomError struct {
Result string
}
CustomError is a struct that will implement the Error() interface
func (CustomError) Error ¶
func (c CustomError) Error() string
type TypedError ¶
type TypedError struct {
// contains filtered or unexported fields
}
TypedError is a way to make an error type you can do err.(type) == ErrorValue
Click to show internal directories.
Click to hide internal directories.