From 8e2610e459d63d4306f75154906fc882448ed138 Mon Sep 17 00:00:00 2001 From: TheInvincible <139259364+TheInvincibleRalph@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:10:23 +0100 Subject: [PATCH] update status_test.go (fix errcheck issue) (#29157) Co-authored-by: Ben Schumacher --- server/.golangci.yml | 1 - server/channels/app/status_test.go | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/.golangci.yml b/server/.golangci.yml index 5759d13f48..76e9883096 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -123,7 +123,6 @@ issues: channels/app/slashcommands/auto_environment.go|\ channels/app/slashcommands/command_test.go|\ channels/app/slashcommands/helper_test.go|\ - channels/app/status_test.go|\ channels/app/support_packet_test.go|\ channels/app/team.go|\ channels/app/team_test.go|\ diff --git a/server/channels/app/status_test.go b/server/channels/app/status_test.go index 1dcc6f5596..2aff8654c5 100644 --- a/server/channels/app/status_test.go +++ b/server/channels/app/status_test.go @@ -177,7 +177,13 @@ func TestSetCustomStatus(t *testing.T) { } { t.Run(testCase.Name, func(t *testing.T) { err := th.App.SetCustomStatus(th.Context, th.BasicUser.Id, testCase.Input) - defer th.App.RemoveCustomStatus(th.Context, th.BasicUser.Id) + + if err == nil { + defer func() { + removeErr := th.App.RemoveCustomStatus(th.Context, th.BasicUser.Id) + require.Nil(t, removeErr) + }() + } if testCase.ExpectsError { require.NotNil(t, err)