Skip to content

Commit

Permalink
fix a strings sql value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xgfone committed Sep 24, 2024
1 parent 7272ac4 commit 1c9bd24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 1c9bd24

Please sign in to comment.