From ac6833c8ee38777bf322ded2ba63c773ab2fa1a1 Mon Sep 17 00:00:00 2001 From: yosssi Date: Thu, 12 Jun 2014 18:14:03 +0900 Subject: [PATCH] Let golint ignore a function whose name starts "Benchmark" when it checks function declarations. Fixes #44. Signed-off-by: David Symonds --- lint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint.go b/lint.go index 8bf077d9..eb27062e 100644 --- a/lint.go +++ b/lint.go @@ -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")