From 62d37235662d768013a81ae868b131c0f368f4fa Mon Sep 17 00:00:00 2001 From: zhangdeman001 Date: Fri, 9 Jun 2023 16:24:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=8E=9F=E5=9B=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=92=8Cmessage=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code.go b/code.go index 576daed..6716c1a 100644 --- a/code.go +++ b/code.go @@ -57,6 +57,9 @@ func InitCodeTableWithMessage(table map[interface{}]map[string]string, convertDe // Date : 16:19 2023/6/9 func InitCodeTableWithCodeList(list []Code, convertDefaultSuccessCode interface{}, convertDefaultLanguage string) { for _, itemCode := range list { + if itemCode.Reason == nil || len(itemCode.Reason) == 0 { + itemCode.Reason = itemCode.Message + } codeTable[itemCode.Value] = itemCode } if nil == convertDefaultSuccessCode {