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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/golinters/goheader.go

Lines changed: 6 additions & 2 deletions
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)