From 573f7153c106aff4bf714d5150226c6987affae5 Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Thu, 2 Nov 2023 16:40:09 +0800 Subject: [PATCH] var-naming: avoid allocations with `(*regexp.Regexp).MatchString` (#928) --- rule/var-naming.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rule/var-naming.go b/rule/var-naming.go index 886d8ae76..7f0ce7155 100644 --- a/rule/var-naming.go +++ b/rule/var-naming.go @@ -127,7 +127,7 @@ func (w *lintNames) check(id *ast.Ident, thing string) { // #851 upperCaseConst support // if it's const - if thing == token.CONST.String() && w.upperCaseConst && upperCaseConstRE.Match([]byte(id.Name)) { + if thing == token.CONST.String() && w.upperCaseConst && upperCaseConstRE.MatchString(id.Name) { return }