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 GitHub
parent 023d7bfa8a
commit da26c5cfe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

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()
}