golangci-lint: Address sqlclosecheck

The linter cannot handle icingadb-migrate.
This commit is contained in:
Alvar Penning 2025-10-14 15:09:05 +02:00
parent d6f67074e1
commit 7ba95af7b5
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -397,7 +397,7 @@ func migrateOneType[IdoRow any](
var err error
lastStmt, err = ht.cache.Preparex(query)
lastStmt, err = ht.cache.Preparex(query) //nolint:sqlclosecheck // either closed in the if block above or in the defer func
if err != nil {
log.With("backend", "cache", "query", query).
Fatalf("%+v", errors.Wrap(err, "can't prepare query"))

View file

@ -124,7 +124,7 @@ func sliceIdoHistory[Row any](
log.With("query", query).Fatalf("%+v", errors.Wrap(err, "can't perform query"))
}
_ = stmt.Close()
_ = stmt.Close() //nolint:sqlclosecheck // no function exit between stmt creation and here, no reason for deferred close
if len(rows) < 1 {
break