1 Star 0 Fork 0

younland / brick

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
error.go 331 Bytes
一键复制 编辑 原始数据 按行查看 历史
严宇川 提交于 2022-01-06 15:48 . v0.0.1
package xerror
import (
"encoding/json"
)
// Error ...
type Error struct {
Code int `json:"code"`
Msg string `json:"msg"`
}
// Error ...
func (e *Error) Error() string {
b, _ := json.Marshal(e)
return string(b)
}
// WithMsg 自定义错误文案
func (e *Error) WithMsg(msg string) *Error {
return New(e.Code, msg)
}
1
https://gitee.com/younland/brick.git
git@gitee.com:younland/brick.git
younland
brick
brick
v1.0.1

搜索帮助

53164aa7 5694891 3bd8fe86 5694891