diff --git a/clause/limit.go b/clause/limit.go index 2082f4d9..184f6025 100644 --- a/clause/limit.go +++ b/clause/limit.go @@ -21,7 +21,7 @@ func (limit Limit) Build(builder Builder) { } if limit.Offset > 0 { if limit.Limit > 0 { - builder.WriteString(" ") + builder.WriteByte(' ') } builder.WriteString("OFFSET ") builder.WriteString(strconv.Itoa(limit.Offset)) diff --git a/clause/where.go b/clause/where.go index 10b6df85..a29401cf 100644 --- a/clause/where.go +++ b/clause/where.go @@ -72,9 +72,9 @@ func buildExprs(exprs []Expression, builder Builder, joinCond string) { } if wrapInParentheses { - builder.WriteString(`(`) + builder.WriteByte('(') expr.Build(builder) - builder.WriteString(`)`) + builder.WriteByte(')') wrapInParentheses = false } else { expr.Build(builder) diff --git a/statement.go b/statement.go index cb471776..abf646b8 100644 --- a/statement.go +++ b/statement.go @@ -130,7 +130,7 @@ func (stmt *Statement) QuoteTo(writer clause.Writer, field interface{}) { writer.WriteByte('(') for idx, d := range v { if idx > 0 { - writer.WriteString(",") + writer.WriteByte(',') } stmt.QuoteTo(writer, d) } @@ -143,7 +143,7 @@ func (stmt *Statement) QuoteTo(writer clause.Writer, field interface{}) { writer.WriteByte('(') for idx, d := range v { if idx > 0 { - writer.WriteString(",") + writer.WriteByte(',') } stmt.DB.Dialector.QuoteTo(writer, d) } diff --git a/utils/tests/dummy_dialecter.go b/utils/tests/dummy_dialecter.go index 9543f750..2990c20f 100644 --- a/utils/tests/dummy_dialecter.go +++ b/utils/tests/dummy_dialecter.go @@ -49,7 +49,7 @@ func (DummyDialector) QuoteTo(writer clause.Writer, str string) { shiftDelimiter = 0 underQuoted = false continuousBacktick = 0 - writer.WriteString("`") + writer.WriteByte('`') } writer.WriteByte(v) continue @@ -74,7 +74,7 @@ func (DummyDialector) QuoteTo(writer clause.Writer, str string) { if continuousBacktick > 0 && !selfQuoted { writer.WriteString("``") } - writer.WriteString("`") + writer.WriteByte('`') } func (DummyDialector) Explain(sql string, vars ...interface{}) string {