From 90a722b99f36b4ca67ebcc303a51336a1e6dc98e Mon Sep 17 00:00:00 2001 From: fengminghong <1439559600@qq.com> Date: Thu, 14 Aug 2025 20:26:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E8=BE=93=E5=87=BAbool=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entgo/update/update.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entgo/update/update.go b/entgo/update/update.go index 0481053..2ef4668 100644 --- a/entgo/update/update.go +++ b/entgo/update/update.go @@ -57,10 +57,14 @@ func ExtractJsonFieldKeyValues(msg proto.Message, paths []string, needToSnakeCas v := rft.Get(fd) switch v.Interface().(type) { - case int32, int64, uint32, uint64, float32, float64, bool: + case bool: + keyValues = append(keyValues, fmt.Sprintf("%t", v.Interface())) + case int32, int64, uint32, uint64, float32, float64: keyValues = append(keyValues, fmt.Sprintf("%d", v.Interface())) case string: keyValues = append(keyValues, fmt.Sprintf("'%s'", v.Interface())) + default: + keyValues = append(keyValues, fmt.Sprintf("%v", v.Interface())) } }