1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-29 22:28:23 +02:00

var-naming: avoid allocations with (*regexp.Regexp).MatchString (#928)

This commit is contained in:
Eng Zer Jun
2023-11-02 16:40:09 +08:00
committed by GitHub
parent fd9a130d7a
commit 573f7153c1

View File

@@ -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
}