diff --git a/clause/set.go b/clause/set.go index 2971f421..5c281d96 100644 --- a/clause/set.go +++ b/clause/set.go @@ -1,6 +1,8 @@ package clause -import "sort" +import ( + "sort" +) type Set []Assignment @@ -28,7 +30,9 @@ func (set Set) Build(builder Builder) { } } else { builder.WriteQuoted(Column{Name: PrimaryKey}) + builder.WriteByte(' ') builder.WriteByte('=') + builder.WriteByte(' ') builder.WriteQuoted(Column{Name: PrimaryKey}) } } diff --git a/clause/set_test.go b/clause/set_test.go index 8e97ac6f..8232c3e8 100644 --- a/clause/set_test.go +++ b/clause/set_test.go @@ -35,7 +35,6 @@ func TestSet(t *testing.T) { { []clause.Interface{ clause.Update{}, - clause.Set([]clause.Assignment{{clause.PrimaryColumn, 1}}), clause.Set([]clause.Assignment{ {clause.Column{Name: "name"}, "jinzhu"}, {clause.Column{Name: "age"}, 18},