From b8bf2e235d0b4497995f6cd749c03be21b83112d Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Fri, 11 Apr 2025 13:51:08 +0200 Subject: [PATCH] [MM-61463] Fix errcheck issues in post_helpers_test.go (#30609) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [MM-61463] Fix errcheck issues in post_helpers_test.go - Added proper error handling for System.Save calls - Removed post_helpers_test.go from errcheck ignore list in .golangci.yml 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * Add back channels/app/plugin_test.go| * Fix server/.golangci.yml --------- Co-authored-by: Claude --- server/.golangci.yml | 1 - server/channels/app/post_helpers_test.go | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/.golangci.yml b/server/.golangci.yml index 85826beb6d2..140fc8ab923 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -102,7 +102,6 @@ issues: channels/app/platform/session.go|\ channels/app/platform/status.go|\ channels/app/platform/web_hub_test.go|\ - channels/app/post_helpers_test.go|\ channels/app/post_test.go|\ channels/app/slack.go|\ channels/app/slashcommands/auto_environment.go|\ diff --git a/server/channels/app/post_helpers_test.go b/server/channels/app/post_helpers_test.go index e47813f07bc..516ac834a77 100644 --- a/server/channels/app/post_helpers_test.go +++ b/server/channels/app/post_helpers_test.go @@ -195,10 +195,11 @@ func TestGetTimeSortedPostAccessibleBounds(t *testing.T) { func TestFilterInaccessiblePosts(t *testing.T) { th := Setup(t) th.App.Srv().SetLicense(model.NewTestLicense("cloud")) - th.App.Srv().Store().System().Save(&model.System{ + err := th.App.Srv().Store().System().Save(&model.System{ Name: model.SystemLastAccessiblePostTime, Value: "2", }) + require.NoError(t, err) defer th.TearDown() @@ -323,10 +324,11 @@ func TestFilterInaccessiblePosts(t *testing.T) { func TestGetFilteredAccessiblePosts(t *testing.T) { th := Setup(t) th.App.Srv().SetLicense(model.NewTestLicense("cloud")) - th.App.Srv().Store().System().Save(&model.System{ + err := th.App.Srv().Store().System().Save(&model.System{ Name: model.SystemLastAccessiblePostTime, Value: "2", }) + require.NoError(t, err) defer th.TearDown() @@ -364,10 +366,11 @@ func TestGetFilteredAccessiblePosts(t *testing.T) { func TestIsInaccessiblePost(t *testing.T) { th := Setup(t) th.App.Srv().SetLicense(model.NewTestLicense("cloud")) - th.App.Srv().Store().System().Save(&model.System{ + err := th.App.Srv().Store().System().Save(&model.System{ Name: model.SystemLastAccessiblePostTime, Value: "2", }) + require.NoError(t, err) defer th.TearDown()