From 2b7b4100d29f28ce1a2410462984f0ee5e607c2e Mon Sep 17 00:00:00 2001 From: Rohan Sharma <117426013+RS-labhub@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:09:06 +0530 Subject: [PATCH] fix: system local errcheck issues (#28539) Co-authored-by: Ben Schumacher --- server/.golangci.yml | 1 - server/channels/api4/system_local.go | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/.golangci.yml b/server/.golangci.yml index 261401ca25..98fc464b99 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -105,7 +105,6 @@ issues: channels/api4/status.go|\ channels/api4/status_test.go|\ channels/api4/system.go|\ - channels/api4/system_local.go|\ channels/api4/system_test.go|\ channels/api4/team.go|\ channels/api4/team_local.go|\ diff --git a/server/channels/api4/system_local.go b/server/channels/api4/system_local.go index 6e03e6e680..eb0c891412 100644 --- a/server/channels/api4/system_local.go +++ b/server/channels/api4/system_local.go @@ -8,6 +8,7 @@ import ( "net/http" "github.com/mattermost/mattermost/server/public/model" + "github.com/mattermost/mattermost/server/public/shared/mlog" "github.com/mattermost/mattermost/server/v8/channels/audit" ) @@ -39,5 +40,7 @@ func localCheckIntegrity(c *Context, w http.ResponseWriter, r *http.Request) { } auditRec.Success() - w.Write(data) + if _, err := w.Write(data); err != nil { + c.Logger.Warn("Failed to write response", mlog.Err(err)) + } }