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

Commit ac6833c

Browse files
yosssidsymonds
authored andcommitted
Let golint ignore a function whose name starts "Benchmark" when it checks function declarations.
Fixes #44. Signed-off-by: David Symonds <[email protected]>
1 parent 2ade831 commit ac6833c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func (f *file) lintNames() {
317317
}
318318
}
319319
case *ast.FuncDecl:
320-
if f.isTest() && (strings.HasPrefix(v.Name.Name, "Example") || strings.HasPrefix(v.Name.Name, "Test")) {
320+
if f.isTest() && (strings.HasPrefix(v.Name.Name, "Example") || strings.HasPrefix(v.Name.Name, "Test") || strings.HasPrefix(v.Name.Name, "Benchmark")) {
321321
return true
322322
}
323323
check(v.Name, "func")

0 commit comments

Comments
 (0)