Skip to content

Commit 4daa573

Browse files
authored
fix(var-naming): set node to package name for underscore in package name (#689)
Setting the entire file AST as the node causes golangci-lint to print the entire file source as the context, and line and column numbers set to 1. Point to the package name node instead. Closes #688
1 parent e10678f commit 4daa573

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rule/var-naming.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (r *VarNamingRule) Apply(file *lint.File, arguments lint.Arguments) []lint.
5656
walker.onFailure(lint.Failure{
5757
Failure: "don't use an underscore in package name",
5858
Confidence: 1,
59-
Node: walker.fileAst,
59+
Node: walker.fileAst.Name,
6060
Category: "naming",
6161
})
6262
}

0 commit comments

Comments
 (0)