From cd0af2265583d88c9339fb87e00cc4f2b0f4d681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Mon, 22 Aug 2022 08:31:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/list_file_db.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/caches/list_file_db.go b/internal/caches/list_file_db.go index d767d37..69fe934 100644 --- a/internal/caches/list_file_db.go +++ b/internal/caches/list_file_db.go @@ -323,9 +323,9 @@ func (this *FileListDB) ListHashes(lastId int64) (hashList []string, maxId int64 if err != nil { return nil, 0, err } + var id int64 + var hash string for rows.Next() { - var id int64 - var hash string err = rows.Scan(&id, &hash) if err != nil { _ = rows.Close() @@ -334,6 +334,8 @@ func (this *FileListDB) ListHashes(lastId int64) (hashList []string, maxId int64 maxId = id hashList = append(hashList, hash) } + + _ = rows.Close() return }