From abd792bbd2b42891cb561ead4c1c83e710bde788 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 21 May 2026 09:07:10 +0000 Subject: [PATCH] fix(usage): silence errcheck on deferred rows.Close CI errcheck flagged the bare 'defer rows.Close()' in computeSourceTotals. Wrap in a closure that discards the close error explicitly; an error here is non-actionable since we have already drained the rows and logged any iteration failure. Refs: #9862 Signed-off-by: Ettore Di Giacinto --- core/http/auth/usage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/http/auth/usage.go b/core/http/auth/usage.go index 0766a1222..98c11093e 100644 --- a/core/http/auth/usage.go +++ b/core/http/auth/usage.go @@ -290,7 +290,7 @@ func computeSourceTotals(db *gorm.DB, userID, apiKeyID string, since time.Time, if err != nil { xlog.Warn("computeSourceTotals: by-key Rows() failed", "error", err) } else { - defer rows.Close() + defer func() { _ = rows.Close() }() out := make([]KeyTotal, 0) for rows.Next() { var (