14 lines
219 B
Go
14 lines
219 B
Go
package utils
|
|
|
|
type ErrorResponse struct {
|
|
Code int `json:"code"`
|
|
Msg string `json:"msg"`
|
|
}
|
|
|
|
func NewErrorResp(code int, msg error) *ErrorResponse {
|
|
return &ErrorResponse{
|
|
Code: code,
|
|
Msg: msg.Error(),
|
|
}
|
|
}
|