Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Commit

Permalink
Let golint ignore a function whose name starts "Benchmark" when it ch…
Browse files Browse the repository at this point in the history
…ecks function declarations.

Fixes #44.

Signed-off-by: David Symonds <dsymonds@golang.org>
  • Loading branch information
yosssi authored and dsymonds committed Jun 13, 2014
1 parent 2ade831 commit ac6833c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func (f *file) lintNames() {
}
}
case *ast.FuncDecl:
if f.isTest() && (strings.HasPrefix(v.Name.Name, "Example") || strings.HasPrefix(v.Name.Name, "Test")) {
if f.isTest() && (strings.HasPrefix(v.Name.Name, "Example") || strings.HasPrefix(v.Name.Name, "Test") || strings.HasPrefix(v.Name.Name, "Benchmark")) {
return true
}
check(v.Name, "func")
Expand Down

0 comments on commit ac6833c

Please sign in to comment.