MM-31062: Rewrite empty string checks to be more idiomatic (#16587)

https://mattermost.atlassian.net/browse/MM-31062

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2020-12-22 19:20:59 +05:30
коммит произвёл GitHub
родитель 1a131b54af
Коммит 6487d0ca91
25 изменённых файлов: 54 добавлений и 54 удалений

Просмотреть файл

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