From e37cc857943cb7c5b6fe2f149532719cd98862a4 Mon Sep 17 00:00:00 2001 From: Rogee Date: Tue, 11 Feb 2025 15:57:03 +0800 Subject: [PATCH] fix: errorx --- templates/project/app/errorx/error.go.tpl | 5 +++++ 1 file changed, 5 insertions(+) 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