background/const/const.go

21 lines
269 B
Go
Raw Normal View History

2019-01-28 03:19:49 +00:00
package _const
var RespCode map[int]string
const (
RESP_ERR_COMON = 101
RESP_ERR_OK = 0
)
func init() {
RespCode[RESP_ERR_OK] = "OK"
RespCode[RESP_ERR_COMON] = "Err"
}
func M(key int) string{
v,ok := RespCode[key]
if ok{
return v
}else {
return ""
}
}