Let golint ignore a function whose name starts "Benchmark" when it checks function declarations.
Fixes #44.
Signed-off-by: David Symonds <dsymonds@golang.org>
diff --git a/lint.go b/lint.go
index 8bf077d..eb27062 100644
--- a/lint.go
+++ b/lint.go
@@ -317,7 +317,7 @@
}
}
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")