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 удалений

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

@@ -559,7 +559,7 @@ func getFilteredUsersStats(c *Context, w http.ResponseWriter, r *http.Request) {
}
}
channelRoles := []string{}
if channelRolesString != "" && len(channelID) != 0 {
if channelRolesString != "" && channelID != "" {
channelRoles, rolesValid = model.CleanRoleNames(strings.Split(channelRolesString, ","))
if !rolesValid {
c.SetInvalidParam("channelRoles")
@@ -567,7 +567,7 @@ func getFilteredUsersStats(c *Context, w http.ResponseWriter, r *http.Request) {
}
}
teamRoles := []string{}
if teamRolesString != "" && len(teamID) != 0 {
if teamRolesString != "" && teamID != "" {
teamRoles, rolesValid = model.CleanRoleNames(strings.Split(teamRolesString, ","))
if !rolesValid {
c.SetInvalidParam("teamRoles")
@@ -673,7 +673,7 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
}
}
channelRoles := []string{}
if channelRolesString != "" && len(inChannelId) != 0 {
if channelRolesString != "" && inChannelId != "" {
channelRoles, rolesValid = model.CleanRoleNames(strings.Split(channelRolesString, ","))
if !rolesValid {
c.SetInvalidParam("channelRoles")
@@ -681,7 +681,7 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
}
}
teamRoles := []string{}
if teamRolesString != "" && len(inTeamId) != 0 {
if teamRolesString != "" && inTeamId != "" {
teamRoles, rolesValid = model.CleanRoleNames(strings.Split(teamRolesString, ","))
if !rolesValid {
c.SetInvalidParam("teamRoles")