From 7af300510e881ec3e1d55cffb88689af8be934f1 Mon Sep 17 00:00:00 2001 From: Palapeli <26661008+mkwcat@users.noreply.github.com> Date: Mon, 6 Apr 2026 07:04:12 -0400 Subject: [PATCH] Logging: Apply lint suggestions --- logging/webhook.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/logging/webhook.go b/logging/webhook.go index a8473af..d454eb4 100644 --- a/logging/webhook.go +++ b/logging/webhook.go @@ -8,15 +8,6 @@ import ( "strings" ) -func contains(slice []string, item string) bool { - for _, v := range slice { - if v == item { - return true - } - } - return false -} - type WebhookAuthorConfig struct { Name string `xml:",chardata"` URL string `xml:"url,attr,omitempty"` @@ -87,7 +78,10 @@ func (w WebhookConfig) ReportEvent(eventType string, eventData map[string]any) { if resp.StatusCode < 200 || resp.StatusCode >= 300 { Error("LOGGING", "Received non-2xx response from webhook:", resp.Status) } - resp.Body.Close() + if err := resp.Body.Close(); err != nil { + Error("LOGGING", "Failed to close webhook response body:", err) + } + } func (w WebhookConfig) RegisterWebhook() {