fix Close() before checking errors
All checks were successful
Go / build (1.21) (push) Successful in 1m14s
Go / build (1.22) (push) Successful in 1m12s

This commit is contained in:
saji 2024-03-06 18:45:32 -06:00
parent 456f84b5c7
commit f380631b5e

2
db.go
View file

@ -366,10 +366,10 @@ func (tdb *TelemDb) GetAllDocuments(ctx context.Context) ([]json.RawMessage, err
const getall = `SELECT data FROM openmct_objects`; const getall = `SELECT data FROM openmct_objects`;
rows, err := tdb.db.QueryxContext(ctx, getall) rows, err := tdb.db.QueryxContext(ctx, getall)
defer rows.Close()
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer rows.Close()
docs := make([]json.RawMessage, 0) docs := make([]json.RawMessage, 0)
for rows.Next() { for rows.Next() {
var j json.RawMessage var j json.RawMessage