mirror of
https://github.com/mudler/LocalAI.git
synced 2026-05-24 08:38:02 -04:00
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 <mudler@localai.io>
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user