From bb15e6eb48bc9d614673f3af9432c70a76707c22 Mon Sep 17 00:00:00 2001 From: guangwu Date: Tue, 23 Apr 2024 11:04:19 +0800 Subject: [PATCH] fix: close file --- cmd/pk/mime.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/pk/mime.go b/cmd/pk/mime.go index b59f29a16..f5ad02e45 100644 --- a/cmd/pk/mime.go +++ b/cmd/pk/mime.go @@ -29,6 +29,7 @@ func showMIME(file string) { if err != nil { log.Fatal(err) } + defer f.Close() mime, _ := magic.MIMETypeFromReader(f) fmt.Println(mime) }