Skip to content

Commit 85049e5

Browse files
Bump go-header to v0.4.1 (#1578)
1 parent aeb9830 commit 85049e5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff 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

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/golinters/goheader.go

+6-2
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)