minor code refactor

This commit is contained in:
ZhengYang 2014-09-11 15:17:48 +08:00
parent ccab9a7044
commit 1f9281c830
1 changed files with 4 additions and 1 deletions

View File

@ -122,7 +122,10 @@ func (qb *MySQLQueryBuilder) Set(kv ...string) QueryBuilder {
}
func (qb *MySQLQueryBuilder) Delete(tables ...string) QueryBuilder {
qb.Tokens = append(qb.Tokens, "DELETE", strings.Join(tables, COMMA_SPACE))
qb.Tokens = append(qb.Tokens, "DELETE")
if len(tables) != 0 {
qb.Tokens = append(qb.Tokens, strings.Join(tables, COMMA_SPACE))
}
return qb
}