From a2afd38f25032c996499ce047fd51789f4fba861 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 26 Dec 2021 14:56:14 +0000 Subject: [PATCH] Enable linter [rule.modifies-value-receiver] and refactor RoleDescriptor (#18093) --- .revive.toml | 1 + models/issue_comment.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.revive.toml b/.revive.toml index 499a4051a12..54f075f84f5 100644 --- a/.revive.toml +++ b/.revive.toml @@ -24,3 +24,4 @@ warningCode = 1 [rule.indent-error-flow] [rule.errorf] [rule.duplicated-imports] +[rule.modifies-value-receiver] diff --git a/models/issue_comment.go b/models/issue_comment.go index e54d41bf0d8..360a212a23b 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -123,8 +123,7 @@ const ( // WithRole enable a specific tag on the RoleDescriptor. func (rd RoleDescriptor) WithRole(role RoleDescriptor) RoleDescriptor { - rd |= (1 << role) - return rd + return rd | (1 << role) } func stringToRoleDescriptor(role string) RoleDescriptor {