1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-28 08:49:11 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}