Skip to content

Commit

Permalink
Change code style
Browse files Browse the repository at this point in the history
  • Loading branch information
ngdinhtoan committed Feb 26, 2015
1 parent ee896e6 commit add189e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions insert.go
Expand Up @@ -194,11 +194,11 @@ func (b InsertBuilder) Suffix(sql string, args ...interface{}) InsertBuilder {
// SetMap set columns and values for insert builder from a map of column name and value
// note that it will reset all previous columns and values was set if any
func (b InsertBuilder) SetMap(clauses map[string]interface{}) InsertBuilder {
cols := make([]string, len(clauses))
vals := make([]interface{}, len(clauses))
idx := 0
for cols[idx], vals[idx] = range clauses {
idx++
cols := make([]string, 0, len(clauses))
vals := make([]interface{}, 0, len(clauses))
for col, val := range clauses {
cols = append(cols, col)
vals = append(vals, val)
}

b = builder.Set(b, "Columns", cols).(InsertBuilder)
Expand Down

0 comments on commit add189e

Please sign in to comment.