mirror of
https://github.com/Icinga/icingadb.git
synced 2026-02-18 18:18:00 -05:00
golangci-lint: Address sqlclosecheck
The linter cannot handle icingadb-migrate.
This commit is contained in:
parent
d6f67074e1
commit
7ba95af7b5
2 changed files with 2 additions and 2 deletions
|
|
@ -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"))
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue