File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ require (
1010 github.com/ashanbrown/makezero v0.0.0-20201205152432-7b7cdbb3025a
1111 github.com/bombsimon/wsl/v3 v3.1.0
1212 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
1414 github.com/fatih/color v1.10.0
1515 github.com/go-critic/go-critic v0.5.2
1616 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 {
5050 a := goheader .New (goheader .WithTemplate (template ), goheader .WithValues (values ))
5151 var res []goanalysis.Issue
5252 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+ })
5458 if i == nil {
5559 continue
5660 }
5761 issue := result.Issue {
5862 Pos : token.Position {
5963 Line : i .Location ().Line + 1 ,
6064 Column : i .Location ().Position ,
61- Filename : pass . Fset . Position ( file . Pos ()). Filename ,
65+ Filename : path ,
6266 },
6367 Text : i .Message (),
6468 FromLinter : goHeaderName ,
You can’t perform that action at this time.
0 commit comments