MM-31062: Rewrite empty string checks to be more idiomatic (#16587)
https://mattermost.atlassian.net/browse/MM-31062 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1a131b54af
Коммит
6487d0ca91
@@ -57,7 +57,7 @@ func (s SqlAuditStore) Get(userId string, offset int, limit int) (model.Audits,
|
||||
Limit(uint64(limit)).
|
||||
Offset(uint64(offset))
|
||||
|
||||
if len(userId) != 0 {
|
||||
if userId != "" {
|
||||
query = query.Where(sq.Eq{"UserId": userId})
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ func (s *SqlGroupStore) createIndexesIfNotExists() {
|
||||
}
|
||||
|
||||
func (s *SqlGroupStore) Create(group *model.Group) (*model.Group, error) {
|
||||
if len(group.Id) != 0 {
|
||||
if group.Id != "" {
|
||||
return nil, store.NewErrInvalidInput("Group", "id", group.Id)
|
||||
}
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ func (us SqlUserStore) UpdateAuthData(userId string, service string, authData *s
|
||||
AuthService = :AuthService,
|
||||
AuthData = :AuthData`
|
||||
|
||||
if len(email) != 0 {
|
||||
if email != "" {
|
||||
query += ", Email = lower(:Email)"
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user