fix: close file

This commit is contained in:
guangwu 2024-04-23 11:04:19 +08:00 committed by Brad Fitzpatrick
parent 4ba112378f
commit bb15e6eb48
1 changed files with 1 additions and 0 deletions

View File

@ -29,6 +29,7 @@ func showMIME(file string) {
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
defer f.Close()
mime, _ := magic.MIMETypeFromReader(f) mime, _ := magic.MIMETypeFromReader(f)
fmt.Println(mime) fmt.Println(mime)
} }