MM-52532: Fix golangci warnings (#23709)
https://mattermost.atlassian.net/browse/MM-52532 - Replace golint with revive - Add makezero linter - Fix all the required linter failures Some issues in enterprise and public modules are yet to be fixed. We send this to expediate things.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
62a3ee8adc
Коммит
c249ba4a66
@@ -811,10 +811,10 @@ func possibleAtMentions(message string) []string {
|
||||
// is a special character for usernames (dot, dash or underscore). If not, it
|
||||
// returns the same string.
|
||||
func trimUsernameSpecialChar(word string) (string, bool) {
|
||||
len := len(word)
|
||||
l := len(word)
|
||||
|
||||
if len > 0 && strings.LastIndexAny(word, usernameSpecialChars) == (len-1) {
|
||||
return word[:len-1], true
|
||||
if l > 0 && strings.LastIndexAny(word, usernameSpecialChars) == (l-1) {
|
||||
return word[:l-1], true
|
||||
}
|
||||
|
||||
return word, false
|
||||
|
||||
Ссылка в новой задаче
Block a user