Combined multiple appends into a single one (#1464)

This commit is contained in:
BIKI DAS 2021-11-18 06:21:44 +05:30 committed by Joe Stump
parent 2195047877
commit 65948a1ccf
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

@ -161,8 +161,10 @@ func (itr InTheRange) ToSql() (sql string, args []interface{}, err error) {
if s.Kind() != reflect.Slice || s.Len() != 2 {
return "", nil, fmt.Errorf("invalid range for 'in' operator: %s", v)
}
and = append(and, squirrel.GtOrEq{f: s.Index(0).Interface()})
and = append(and, squirrel.LtOrEq{f: s.Index(1).Interface()})
and = append(and,
squirrel.GtOrEq{f: s.Index(0).Interface()},
squirrel.LtOrEq{f: s.Index(1).Interface()},
)
}
return and.ToSql()
}