Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OK = &KError{Code: 0, Message: "OK"} InternalServerError = &KError{Code: 10001, Message: "Internal server error."} ErrBind = &KError{Code: 10002, Message: "Error occurred while binding the request body to the struct."} )
1 00 01 服务级别 模块 具体错误
Functions ¶
func Wrap ¶
Wrap is a simple wrapper around Errorf that is doing error wrapping. You can read how that works in https://godoc.org/golang.org/x/xerrors#Errorf but its API is very implicit which is a reason for this wrapper. There is also a discussion (https://github.com/golang/go/issues/29934) where many comments make arguments for such wrapper so hopefully it will be added in the standard lib later.
Types ¶
Click to show internal directories.
Click to hide internal directories.