Combined multiple appends into a single one (#1464)
This commit is contained in:
parent
023d7bfa8a
commit
da26c5cfe0
1 changed files with 4 additions and 2 deletions
|
|
@ -161,8 +161,10 @@ func (itr InTheRange) ToSql() (sql string, args []interface{}, err error) {
|
||||||
if s.Kind() != reflect.Slice || s.Len() != 2 {
|
if s.Kind() != reflect.Slice || s.Len() != 2 {
|
||||||
return "", nil, fmt.Errorf("invalid range for 'in' operator: %s", v)
|
return "", nil, fmt.Errorf("invalid range for 'in' operator: %s", v)
|
||||||
}
|
}
|
||||||
and = append(and, squirrel.GtOrEq{f: s.Index(0).Interface()})
|
and = append(and,
|
||||||
and = append(and, squirrel.LtOrEq{f: s.Index(1).Interface()})
|
squirrel.GtOrEq{f: s.Index(0).Interface()},
|
||||||
|
squirrel.LtOrEq{f: s.Index(1).Interface()},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return and.ToSql()
|
return and.ToSql()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue