README ¶ Ecode模块 Ecode模块提供了常见的错误码、初始化错误码以及解释错误码的功能。 使用示例: ecode:=New("GF021103","测试错误码") fmt.Println(ecode.Error()) Expand ▾ Collapse ▴ Documentation ¶ Index ¶ Variables type Codes func Cause(err error) Codes func New(code, msg string) Codes func String(e string) Codes func (e Codes) Error() string Constants ¶ This section is empty. Variables ¶ View Source var ( OK = New("200", "") ) Functions ¶ This section is empty. Types ¶ type Codes ¶ type Codes struct { Code string `json:"code,omitempty"` Msg string `json:"msg,omitempty"` } func Cause ¶ func Cause(err error) Codes func New ¶ func New(code, msg string) Codes func String ¶ func String(e string) Codes func (Codes) Error ¶ func (e Codes) Error() string Source Files ¶ View all Source files ecode.go http.go Click to show internal directories. Click to hide internal directories.