package utils type Error struct { Code int `json:"code"` Message string `json:"message"` } func NewError(code int, msg string) error { return Error{code, msg} } func (this Error) Error() string { return this.Message }