Skip to content

Commit

Permalink
Update gochecknoglobals to abbdf6ec0afbf03522985f899c67ead98818854d
Browse files Browse the repository at this point in the history
This fixes the line number for variables inside a 'var' group.
See leighmcculloch/gochecknoglobals#9
  • Loading branch information
leonklingele authored and alecthomas committed Jan 21, 2019
1 parent 3277e05 commit 44efbc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _linters/src/4d63.com/gochecknoglobals/check_no_globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ func checkNoGlobals(rootPath string, includeTests bool) ([]string, error) {
continue
}
filename := fset.Position(genDecl.TokPos).Filename
line := fset.Position(genDecl.TokPos).Line
for _, spec := range genDecl.Specs {
valueSpec := spec.(*ast.ValueSpec)
for _, vn := range valueSpec.Names {
if isWhitelisted(vn) {
continue
}
line := fset.Position(vn.Pos()).Line
message := fmt.Sprintf("%s:%d %s is a global variable", filename, line, vn.Name)
messages = append(messages, message)
}
Expand Down
2 changes: 1 addition & 1 deletion _linters/src/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"importpath": "4d63.com/gochecknoglobals",
"repository": "https://github.com/leighmcculloch/gochecknoglobals",
"vcs": "git",
"revision": "5090db600a84f7a401cb031f4e8e2e420b0e1ecd",
"revision": "abbdf6ec0afbf03522985f899c67ead98818854d",
"branch": "master",
"notests": true
},
Expand Down

0 comments on commit 44efbc6

Please sign in to comment.