Skip to content

Commit ca085d9

Browse files
committed
Fix linting issues
1 parent b9ecec6 commit ca085d9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

expr.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (e aliasExpr) ToSql() (sql string, args []interface{}, err error) {
7878
// .Where(Eq{"id": 1})
7979
type Eq map[string]interface{}
8080

81-
func (eq Eq) toSql(useNotOpr bool) (sql string, args []interface{}, err error) {
81+
func (eq Eq) toSQL(useNotOpr bool) (sql string, args []interface{}, err error) {
8282
if len(eq) == 0 {
8383
// Empty Sql{} evaluates to true.
8484
sql = sqlTrue
@@ -102,7 +102,7 @@ func (eq Eq) toSql(useNotOpr bool) (sql string, args []interface{}, err error) {
102102

103103
sortedKeys := getSortedKeys(eq)
104104
for _, key := range sortedKeys {
105-
expr := ""
105+
var expr string
106106
val := eq[key]
107107

108108
switch v := val.(type) {
@@ -149,7 +149,7 @@ func (eq Eq) toSql(useNotOpr bool) (sql string, args []interface{}, err error) {
149149
}
150150

151151
func (eq Eq) ToSql() (sql string, args []interface{}, err error) {
152-
return eq.toSql(false)
152+
return eq.toSQL(false)
153153
}
154154

155155
// NotEq is syntactic sugar for use with Where/Having/Set methods.
@@ -158,7 +158,7 @@ func (eq Eq) ToSql() (sql string, args []interface{}, err error) {
158158
type NotEq Eq
159159

160160
func (neq NotEq) ToSql() (sql string, args []interface{}, err error) {
161-
return Eq(neq).toSql(true)
161+
return Eq(neq).toSQL(true)
162162
}
163163

164164
// Like is syntactic sugar for use with LIKE conditions.
@@ -238,7 +238,7 @@ func (lt Lt) toSql(opposite, orEq bool) (sql string, args []interface{}, err err
238238

239239
sortedKeys := getSortedKeys(lt)
240240
for _, key := range sortedKeys {
241-
expr := ""
241+
var expr string
242242
val := lt[key]
243243

244244
switch v := val.(type) {
@@ -304,12 +304,12 @@ func (c conj) join(sep, defaultExpr string) (sql string, args []interface{}, err
304304
}
305305
var sqlParts []string
306306
for _, sqlizer := range c {
307-
partSql, partArgs, err := sqlizer.ToSql()
307+
partSQL, partArgs, err := sqlizer.ToSql()
308308
if err != nil {
309309
return "", nil, err
310310
}
311-
if partSql != "" {
312-
sqlParts = append(sqlParts, partSql)
311+
if partSQL != "" {
312+
sqlParts = append(sqlParts, partSQL)
313313
args = append(args, partArgs...)
314314
}
315315
}
@@ -319,12 +319,14 @@ func (c conj) join(sep, defaultExpr string) (sql string, args []interface{}, err
319319
return
320320
}
321321

322+
// And conjunction Sqlizers
322323
type And conj
323324

324325
func (a And) ToSql() (string, []interface{}, error) {
325326
return conj(a).join(" AND ", sqlTrue)
326327
}
327328

329+
// Or conjunction Sqlizers
328330
type Or conj
329331

330332
func (o Or) ToSql() (string, []interface{}, error) {

0 commit comments

Comments
 (0)