From 0ec4522bee767ec4763e1dcf8d874a3a5a7f6137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Tue, 26 Jul 2022 15:22:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B9=B6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.go b/main.go index 62225e5..1a61330 100644 --- a/main.go +++ b/main.go @@ -90,15 +90,14 @@ func main() { continue } im, _, err := image.Decode(f) + _ = f.Close() if err != nil { fmt.Println("ERROR:", err) - _ = f.Close() continue } dh, err := goimagehash.DifferenceHash(im) if err != nil { fmt.Println("ERROR:", err) - _ = f.Close() continue } mu.Lock() @@ -108,7 +107,6 @@ func main() { }) fmt.Print("read: ", len(chklst), " / ", len(imgs), "\r") mu.Unlock() - _ = f.Close() } } wg.Done()