Documentation ¶ Index ¶ Variables func Is(err error, target Code) bool type Code func New(val int, msg string) Code Constants ¶ This section is empty. Variables ¶ View Source var ( OK = New(0, "OK") Unknown = New(-1, "System Exception") ) Functions ¶ func Is ¶ func Is(err error, target Code) bool Is reports whether the err is the target code Types ¶ type Code ¶ type Code interface { error // V returns the code value Val() int // M returns the code message Msg() string // New returns a newly allocated code with the same value. New(msg string, args ...any) Code } Code the code definition for API func New ¶ func New(val int, msg string) Code Source Files ¶ View all Source files code.go Click to show internal directories. Click to hide internal directories.