Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OK = New(0, "OK") Err = New(-1, "System Exception") )
Functions ¶
Types ¶
type Code ¶
type Code interface {
error
// Value returns the code value
Value() int
// Message returns the code message
Message() string
// WithMsg returns a new Code with the same value but a different message
WithMsg(msg string) Code
// WithMsgF returns a new Code with the same value and a formatted message
WithMsgF(format string, args ...any) Code
}
Code the code definition for API
Click to show internal directories.
Click to hide internal directories.