Skip to content

Commit

Permalink
ignoreing the slice and map styling on test files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacobbrewer1 committed Feb 6, 2025
1 parent e1efd01 commit 27e412f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ linters:
- iface
- thelper
- tparallel
issues:
exclude-rules:
- path: (.+)_test.go
linters:
- revive
text: "^(enforce-slice-style|enforce-map-style)"
linters-settings:
revive:
# Default: false
Expand Down
14 changes: 7 additions & 7 deletions sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ func (s *newSQLPatchSuite) TestNewSQLPatch_fail_noFields() {
// This will return a patch object with no fields
patch := NewSQLPatch(obj)

s.Equal(make([]string, 0), patch.fields)
s.Equal(make([]any, 0), patch.args)
s.Equal([]string{}, patch.fields)
s.Equal([]any{}, patch.args)
}

func (s *newSQLPatchSuite) TestNewSQLPatch_Success_IncludeZeroValue() {
Expand Down Expand Up @@ -982,10 +982,10 @@ func (s *generateSQLSuite) TestGenerateSQL_Success_multipleJoin() {
mw.On("Where").Return("age = ?", []any{18})

mj := NewMockJoiner(s.T())
mj.On("Join").Return("JOIN table2 ON table1.id = table2.id", make([]any, 0))
mj.On("Join").Return("JOIN table2 ON table1.id = table2.id", []any{})

mj2 := NewMockJoiner(s.T())
mj2.On("Join").Return("JOIN table3 ON table1.id = table3.id", make([]any, 0))
mj2.On("Join").Return("JOIN table3 ON table1.id = table3.id", []any{})

sqlStr, args, err := GenerateSQL(obj,
WithTable("test_table"),
Expand Down Expand Up @@ -1015,7 +1015,7 @@ func (s *generateSQLSuite) TestGenerateSQL_Success_withJoinAndWhere() {
mw.On("Where").Return("age = ?", []any{18})

mj := NewMockJoiner(s.T())
mj.On("Join").Return("JOIN table2 ON table1.id = table2.id", make([]any, 0))
mj.On("Join").Return("JOIN table2 ON table1.id = table2.id", []any{})

sqlStr, args, err := GenerateSQL(obj,
WithTable("test_table"),
Expand Down Expand Up @@ -1044,10 +1044,10 @@ func (s *generateSQLSuite) TestGenerateSQL_Success_withJoinAndWhereAndJoin() {
mw.On("Where").Return("age = ?", []any{18})

mj := NewMockJoiner(s.T())
mj.On("Join").Return("JOIN table2 ON table1.id = table2.id", make([]any, 0))
mj.On("Join").Return("JOIN table2 ON table1.id = table2.id", []any{})

mj2 := NewMockJoiner(s.T())
mj2.On("Join").Return("JOIN table3 ON table1.id = table3.id", make([]any, 0))
mj2.On("Join").Return("JOIN table3 ON table1.id = table3.id", []any{})

sqlStr, args, err := GenerateSQL(obj,
WithTable("test_table"),
Expand Down

0 comments on commit 27e412f

Please sign in to comment.