Skip to content

Commit

Permalink
Bump go-header to v0.4.1
Browse files Browse the repository at this point in the history
Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
  • Loading branch information
denis-tingaikin committed Dec 27, 2020
1 parent df9278e commit b1384c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/ashanbrown/makezero v0.0.0-20201205152432-7b7cdbb3025a
github.com/bombsimon/wsl/v3 v3.1.0
github.com/daixiang0/gci v0.2.7
github.com/denis-tingajkin/go-header v0.3.1
github.com/denis-tingajkin/go-header v0.4.1
github.com/fatih/color v1.10.0
github.com/go-critic/go-critic v0.5.2
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions pkg/golinters/goheader.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,19 @@ func NewGoHeader() *goanalysis.Linter {
a := goheader.New(goheader.WithTemplate(template), goheader.WithValues(values))
var res []goanalysis.Issue
for _, file := range pass.Files {
i := a.Analyze(file)
path := pass.Fset.Position(file.Pos()).Filename
i := a.Analyze(&goheader.Target{
File: file,
Path: path,
})
if i == nil {
continue
}
issue := result.Issue{
Pos: token.Position{
Line: i.Location().Line + 1,
Column: i.Location().Position,
Filename: pass.Fset.Position(file.Pos()).Filename,
Filename: path,
},
Text: i.Message(),
FromLinter: goHeaderName,
Expand Down

0 comments on commit b1384c4

Please sign in to comment.