From f380631b5e0a3cbbe98e70d5d6aa2905e7de7334 Mon Sep 17 00:00:00 2001 From: saji Date: Wed, 6 Mar 2024 18:45:32 -0600 Subject: [PATCH] fix Close() before checking errors --- db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.go b/db.go index 7743d69..f46e787 100644 --- a/db.go +++ b/db.go @@ -366,10 +366,10 @@ func (tdb *TelemDb) GetAllDocuments(ctx context.Context) ([]json.RawMessage, err const getall = `SELECT data FROM openmct_objects`; rows, err := tdb.db.QueryxContext(ctx, getall) - defer rows.Close() if err != nil { return nil, err } + defer rows.Close() docs := make([]json.RawMessage, 0) for rows.Next() { var j json.RawMessage