From c5a504883d7f29e4ed38d57bf6bf4f4bd6d3c010 Mon Sep 17 00:00:00 2001 From: CarlssonFilip <123748780+CarlssonFilip@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:02:56 +0200 Subject: [PATCH] [GH-28353] Fix errcheck issues in server/channels/api4/channel_bookmark_test.go (#28358) --- server/.golangci.yml | 1 - server/channels/api4/channel_bookmark_test.go | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/server/.golangci.yml b/server/.golangci.yml index 2f7af27772..c52a3f85cb 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -64,7 +64,6 @@ issues: channels/api4/brand.go|\ channels/api4/brand_test.go|\ channels/api4/channel.go|\ - channels/api4/channel_bookmark_test.go|\ channels/api4/channel_category.go|\ channels/api4/channel_test.go|\ channels/api4/cloud.go|\ diff --git a/server/channels/api4/channel_bookmark_test.go b/server/channels/api4/channel_bookmark_test.go index 6b8b7ac1cd..4f323d0623 100644 --- a/server/channels/api4/channel_bookmark_test.go +++ b/server/channels/api4/channel_bookmark_test.go @@ -22,7 +22,8 @@ func TestCreateChannelBookmark(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() - th.App.SetPhase2PermissionsMigrationStatus(true) + err := th.App.SetPhase2PermissionsMigrationStatus(true) + require.NoError(t, err) t.Run("should not work without a license", func(t *testing.T) { channelBookmark := &model.ChannelBookmark{ @@ -268,7 +269,8 @@ func TestEditChannelBookmark(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() - th.App.SetPhase2PermissionsMigrationStatus(true) + err := th.App.SetPhase2PermissionsMigrationStatus(true) + require.NoError(t, err) t.Run("should not work without a license", func(t *testing.T) { _, _, err := th.Client.UpdateChannelBookmark(context.Background(), th.BasicChannel.Id, model.NewId(), &model.ChannelBookmarkPatch{}) @@ -646,7 +648,8 @@ func TestUpdateChannelBookmarkSortOrder(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() - th.App.SetPhase2PermissionsMigrationStatus(true) + err := th.App.SetPhase2PermissionsMigrationStatus(true) + require.NoError(t, err) createBookmark := func(name, channelId string) *model.ChannelBookmarkWithFileInfo { b := &model.ChannelBookmark{ @@ -780,7 +783,8 @@ func TestUpdateChannelBookmarkSortOrder(t *testing.T) { originalBookmark, appErr := th.App.GetBookmark(tc.bookmarkId, false) require.Nil(t, appErr) defer func() { - th.App.UpdateChannelBookmarkSortOrder(originalBookmark.Id, originalBookmark.ChannelId, originalBookmark.SortOrder, "") + _, err := th.App.UpdateChannelBookmarkSortOrder(originalBookmark.Id, originalBookmark.ChannelId, originalBookmark.SortOrder, "") + require.Nil(t, err) }() bookmarks, resp, err := tc.userClient.UpdateChannelBookmarkSortOrder(context.Background(), tc.channelId, tc.bookmarkId, tc.sortOrder) @@ -1015,7 +1019,8 @@ func TestDeleteChannelBookmark(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() - th.App.SetPhase2PermissionsMigrationStatus(true) + err := th.App.SetPhase2PermissionsMigrationStatus(true) + require.NoError(t, err) th.Context.Session().UserId = th.BasicUser.Id // set the user for the session @@ -1347,7 +1352,8 @@ func TestListChannelBookmarksForChannel(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() - th.App.SetPhase2PermissionsMigrationStatus(true) + err := th.App.SetPhase2PermissionsMigrationStatus(true) + require.NoError(t, err) createBookmark := func(name, channelId string) *model.ChannelBookmarkWithFileInfo { b := &model.ChannelBookmark{