Skip to content

Commit

Permalink
Merge pull request #236 from testwill/close_file
Browse files Browse the repository at this point in the history
fix: close file after uploading binary file
  • Loading branch information
huandu authored May 24, 2024
2 parents 8b34431 + d374ad9 commit 38d95ed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions params.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ func (params Params) encodeMultipartForm(writer io.Writer) (mime string, err err
return
}

defer file.Close()

_, err = io.Copy(dst, file)

if err != nil {
Expand Down

0 comments on commit 38d95ed

Please sign in to comment.