From 733156ed23e6f0b7434d84e3b61ad496fc87eed0 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Tue, 23 Jul 2024 13:10:31 +0200 Subject: [PATCH] [MM-59825] Fix linter error found by updated govet (#27715) --- server/channels/app/channel_bookmark_test.go | 6 +++--- server/channels/app/integration_action_test.go | 2 +- server/channels/app/user_test.go | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/server/channels/app/channel_bookmark_test.go b/server/channels/app/channel_bookmark_test.go index 3c3070d28e9db..7e222bf5a9d7c 100644 --- a/server/channels/app/channel_bookmark_test.go +++ b/server/channels/app/channel_bookmark_test.go @@ -486,13 +486,13 @@ func TestUpdateChannelBookmarkSortOrder(t *testing.T) { t.Run("change order of bookmarks error when new index is out of bounds", func(t *testing.T) { _, appErr = th.App.UpdateChannelBookmarkSortOrder(bookmark3.Id, channelId, int64(-1), "") - assert.Error(t, appErr) + assert.NotNil(t, appErr) _, appErr = th.App.UpdateChannelBookmarkSortOrder(bookmark3.Id, channelId, int64(5), "") - assert.Error(t, appErr) + assert.NotNil(t, appErr) }) t.Run("change order of bookmarks error when bookmark not found", func(t *testing.T) { _, appErr = th.App.UpdateChannelBookmarkSortOrder(model.NewId(), channelId, int64(0), "") - assert.Error(t, appErr) + assert.NotNil(t, appErr) }) } diff --git a/server/channels/app/integration_action_test.go b/server/channels/app/integration_action_test.go index 96e53aae467b2..a033ab5457a9f 100644 --- a/server/channels/app/integration_action_test.go +++ b/server/channels/app/integration_action_test.go @@ -167,7 +167,7 @@ func TestPostActionEmptyResponse(t *testing.T) { }) _, err = th.App.DoPostActionWithCookie(th.Context, post.Id, attachments[0].Actions[0].Id, th.BasicUser.Id, "", nil) - require.Error(t, err) + require.NotNil(t, err) assert.Contains(t, err.DetailedError, "context deadline exceeded") }) } diff --git a/server/channels/app/user_test.go b/server/channels/app/user_test.go index 8f8a26c9abad0..3856d30401a82 100644 --- a/server/channels/app/user_test.go +++ b/server/channels/app/user_test.go @@ -1242,7 +1242,7 @@ func TestPasswordChangeSessionTermination(t *testing.T) { require.False(t, session.IsExpired()) session2, err = th.App.GetSession(session2.Token) - require.Error(t, err) + require.NotNil(t, err) require.Nil(t, session2) // Cleanup @@ -1311,11 +1311,11 @@ func TestPasswordChangeSessionTermination(t *testing.T) { require.Nil(t, err) session, err = th.App.GetSession(session.Token) - require.Error(t, err) + require.NotNil(t, err) require.Nil(t, session) session2, err = th.App.GetSession(session2.Token) - require.Error(t, err) + require.NotNil(t, err) require.Nil(t, session2) // Cleanup @@ -2136,7 +2136,7 @@ func TestGetUsersForReporting(t *testing.T) { EndAt: 500, }, }) - require.Error(t, err) + require.NotNil(t, err) require.Nil(t, userReports) }) @@ -2150,7 +2150,7 @@ func TestGetUsersForReporting(t *testing.T) { PageSize: 50, }, }) - require.Error(t, err) + require.NotNil(t, err) require.Nil(t, userReports) })