File tree 3 files changed +9
-5
lines changed
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ require (
10
10
github.com/ashanbrown/makezero v0.0.0-20201205152432-7b7cdbb3025a
11
11
github.com/bombsimon/wsl/v3 v3.1.0
12
12
github.com/daixiang0/gci v0.2.7
13
- github.com/denis-tingajkin/go-header v0.3 .1
13
+ github.com/denis-tingajkin/go-header v0.4 .1
14
14
github.com/fatih/color v1.10.0
15
15
github.com/go-critic/go-critic v0.5.2
16
16
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b
Original file line number Diff line number Diff line change @@ -50,15 +50,19 @@ func NewGoHeader() *goanalysis.Linter {
50
50
a := goheader .New (goheader .WithTemplate (template ), goheader .WithValues (values ))
51
51
var res []goanalysis.Issue
52
52
for _ , file := range pass .Files {
53
- i := a .Analyze (file )
53
+ path := pass .Fset .Position (file .Pos ()).Filename
54
+ i := a .Analyze (& goheader.Target {
55
+ File : file ,
56
+ Path : path ,
57
+ })
54
58
if i == nil {
55
59
continue
56
60
}
57
61
issue := result.Issue {
58
62
Pos : token.Position {
59
63
Line : i .Location ().Line + 1 ,
60
64
Column : i .Location ().Position ,
61
- Filename : pass . Fset . Position ( file . Pos ()). Filename ,
65
+ Filename : path ,
62
66
},
63
67
Text : i .Message (),
64
68
FromLinter : goHeaderName ,
You can’t perform that action at this time.
0 commit comments