From 1c9bd24d2203128fa5ac318dcfbe4e2be701f756 Mon Sep 17 00:00:00 2001 From: xgfone Date: Wed, 25 Sep 2024 00:00:17 +0800 Subject: [PATCH] fix a strings sql value bug --- model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.go b/model.go index 144468d..1be8d92 100644 --- a/model.go +++ b/model.go @@ -52,7 +52,7 @@ type Strings []string // Value implements the interface driver.Valuer to encode the map to a sql value(string). func (vs Strings) Value() (driver.Value, error) { if len(vs) == 0 || (len(vs) == 1 && vs[0] == "") { - return nil, nil + return "", nil } return strings.Join(vs, ","), nil }