@@ -4,11 +4,10 @@ import (
4
4
"go/token"
5
5
"testing"
6
6
7
- "github.com/golangci/golangci-lint/pkg/config"
8
7
"github.com/golangci/golangci-lint/pkg/result"
9
8
)
10
9
11
- func newFLIssue (file string , line int ) result.Issue {
10
+ func newULIssue (file string , line int ) result.Issue {
12
11
return result.Issue {
13
12
Pos : token.Position {
14
13
Filename : file ,
@@ -18,26 +17,20 @@ func newFLIssue(file string, line int) result.Issue {
18
17
}
19
18
20
19
func TestUniqByLine (t * testing.T ) {
21
- cfg := config.Config {}
22
- cfg .Issues .UniqByLine = true
23
-
24
- p := NewUniqByLine (& cfg )
25
- i1 := newFLIssue ("f1" , 1 )
20
+ p := NewUniqByLine (true )
21
+ i1 := newULIssue ("f1" , 1 )
26
22
27
23
processAssertSame (t , p , i1 )
28
24
processAssertEmpty (t , p , i1 ) // check skipping
29
25
processAssertEmpty (t , p , i1 ) // check accumulated error
30
26
31
- processAssertSame (t , p , newFLIssue ("f1" , 2 )) // another line
32
- processAssertSame (t , p , newFLIssue ("f2" , 1 )) // another file
27
+ processAssertSame (t , p , newULIssue ("f1" , 2 )) // another line
28
+ processAssertSame (t , p , newULIssue ("f2" , 1 )) // another file
33
29
}
34
30
35
31
func TestUniqByLineDisabled (t * testing.T ) {
36
- cfg := config.Config {}
37
- cfg .Issues .UniqByLine = false
38
-
39
- p := NewUniqByLine (& cfg )
40
- i1 := newFLIssue ("f1" , 1 )
32
+ p := NewUniqByLine (false )
33
+ i1 := newULIssue ("f1" , 1 )
41
34
42
35
processAssertSame (t , p , i1 )
43
36
processAssertSame (t , p , i1 ) // check the same issue passed twice
0 commit comments