diff --git a/templates/project/app/errorx/error.go.tpl b/templates/project/app/errorx/error.go.tpl index f9af7be..9234537 100644 --- a/templates/project/app/errorx/error.go.tpl +++ b/templates/project/app/errorx/error.go.tpl @@ -44,6 +44,11 @@ func New(code, statusCode int, message string) *Response { } } +func (r *Response) WithMsg(msg string) *Response { + r.Message = msg + return r +} + func (r *Response) Sql(sql string) *Response { r.sql = sql return r