Ai
1 Star 0 Fork 1

周涛/go_utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ServerCode.go 430 Bytes
一键复制 编辑 原始数据 按行查看 历史
周涛 提交于 2020-12-16 15:10 +08:00 . myError模块适配protobuf格式
package service_code
const (
Success = 1
UnknownError = 0
ParamsVerifyError = 8101
MethodNotAllowed = 8201
)
var ServerMsgMap = map[int]string{
Success: "成功",
UnknownError: "未知错误",
ParamsVerifyError: "参数验证失败",
MethodNotAllowed: "不被允许的方法",
}
func GetServerMsg(code int) string {
msg, ok := ServerMsgMap[code]
if ok {
return msg
}
return "unknown service code"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/super_step/go_utils.git
git@gitee.com:super_step/go_utils.git
super_step
go_utils
go_utils
v1.1.6

搜索帮助