aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2020-02-21 00:22:06 +0000
committerFelix Hanley <felix@userspace.com.au>2020-02-21 00:22:06 +0000
commitd68c6aad01c2f6e7f30389536152e1f96682b5cd (patch)
treee6049e416cbf4d4ced14342b0ceef7cdc388f02e
parentf0b363741a50ecba0ae7785c32e96c742af9e3db (diff)
downloadsws-d68c6aad01c2f6e7f30389536152e1f96682b5cd.tar.gz
sws-d68c6aad01c2f6e7f30389536152e1f96682b5cd.tar.bz2
Close rows
-rw-r--r--store/sqlite3.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/store/sqlite3.go b/store/sqlite3.go
index 44e0da1..0dec7fb 100644
--- a/store/sqlite3.go
+++ b/store/sqlite3.go
@@ -23,6 +23,8 @@ func (s *Sqlite3) GetSites() ([]*sws.Site, error) {
if err != nil {
return nil, err
}
+ defer rows.Close()
+
var out []*sws.Site
for rows.Next() {
@@ -72,6 +74,7 @@ func (s *Sqlite3) GetHits(d sws.Site, filter map[string]interface{}) ([]*sws.Hit
return nil, err
}
defer rows.Close()
+
for rows.Next() {
h := &sws.Hit{}
if err := rows.StructScan(h); err != nil {