From 2b723099a6c66317a81338c47d1e7e6c75cd7f75 Mon Sep 17 00:00:00 2001 From: Rohan Sharma <117426013+RS-labhub@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:15:43 +0530 Subject: [PATCH] fix: shared channel test errcheck issues (#28551) * fix: shared channel test errcheck issues --- server/.golangci.yml | 2 +- server/channels/api4/shared_channel_test.go | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/server/.golangci.yml b/server/.golangci.yml index 086a6740b0..12d7aa989e 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -93,7 +93,7 @@ issues: channels/api4/saml.go|\ channels/api4/scheme.go|\ channels/api4/scheme_test.go|\ - channels/api4/shared_channel_test.go|\ + channels/api4/shared_channel.go|\ channels/api4/status.go|\ channels/api4/status_test.go|\ channels/api4/system_local.go|\ diff --git a/server/channels/api4/shared_channel_test.go b/server/channels/api4/shared_channel_test.go index 1d01dde3b3..cecb507c36 100644 --- a/server/channels/api4/shared_channel_test.go +++ b/server/channels/api4/shared_channel_test.go @@ -165,7 +165,10 @@ func TestCreateDirectChannelWithRemoteUser(t *testing.T) { th := setupForSharedChannels(t).InitBasic() defer th.TearDown() client := th.Client - defer client.Logout(context.Background()) + defer func() { + _, err := client.Logout(context.Background()) + require.NoError(t, err) + }() localUser := th.BasicUser remoteUser := th.CreateUser() @@ -185,7 +188,10 @@ func TestCreateDirectChannelWithRemoteUser(t *testing.T) { th := setupForSharedChannels(t).InitBasic() defer th.TearDown() client := th.Client - defer client.Logout(context.Background()) + defer func() { + _, err := client.Logout(context.Background()) + require.NoError(t, err) + }() localUser := th.BasicUser remoteUser := th.CreateUser() @@ -214,7 +220,10 @@ func TestCreateDirectChannelWithRemoteUser(t *testing.T) { th := setupForSharedChannels(t).InitBasic() defer th.TearDown() client := th.Client - defer client.Logout(context.Background()) + defer func() { + _, err := client.Logout(context.Background()) + require.NoError(t, err) + }() localUser := th.BasicUser remoteUser := th.CreateUser()