Run gosimple against codebase (#12928)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d7649fbf31
Коммит
7a665aacdd
@@ -607,8 +607,7 @@ func TestUploadFiles(t *testing.T) {
|
||||
|
||||
expected, err := ioutil.ReadFile(filepath.Join(testDir, name))
|
||||
require.Nil(t, err)
|
||||
|
||||
if bytes.Compare(data, expected) != 0 {
|
||||
if !bytes.Equal(data, expected) {
|
||||
tf, err := ioutil.TempFile("", fmt.Sprintf("test_%v_*_%s", i, name))
|
||||
require.Nil(t, err)
|
||||
_, _ = io.Copy(tf, bytes.NewReader(data))
|
||||
|
||||
@@ -397,7 +397,6 @@ func getRedirectLocation(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
m["location"] = location
|
||||
|
||||
w.Write([]byte(model.MapToJson(m)))
|
||||
return
|
||||
}
|
||||
|
||||
func pushNotificationAck(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -415,5 +414,4 @@ func pushNotificationAck(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
ReturnStatusOK(w)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1369,7 +1369,8 @@ func TestGetUsersByGroupChannelIds(t *testing.T) {
|
||||
usersByChannelId, resp := th.Client.GetUsersByGroupChannelIds([]string{gc1.Id})
|
||||
CheckNoError(t, resp)
|
||||
|
||||
users, _ := usersByChannelId[gc1.Id]
|
||||
users, ok := usersByChannelId[gc1.Id]
|
||||
assert.True(t, ok)
|
||||
userIds := []string{}
|
||||
for _, user := range users {
|
||||
userIds = append(userIds, user.Id)
|
||||
@@ -1381,7 +1382,7 @@ func TestGetUsersByGroupChannelIds(t *testing.T) {
|
||||
usersByChannelId, resp = th.Client.GetUsersByGroupChannelIds([]string{gc1.Id})
|
||||
CheckNoError(t, resp)
|
||||
|
||||
_, ok := usersByChannelId[gc1.Id]
|
||||
_, ok = usersByChannelId[gc1.Id]
|
||||
require.False(t, ok)
|
||||
|
||||
th.Client.Logout()
|
||||
|
||||
Ссылка в новой задаче
Block a user