From da26c5cfe00c3104446049f8c355d5fe249d6302 Mon Sep 17 00:00:00 2001 From: BIKI DAS Date: Thu, 18 Nov 2021 06:21:44 +0530 Subject: [PATCH] Combined multiple appends into a single one (#1464) --- model/criteria/operators.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/model/criteria/operators.go b/model/criteria/operators.go index ac81348bf..2ebca2b61 100644 --- a/model/criteria/operators.go +++ b/model/criteria/operators.go @@ -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() }