Skip to content

Commit

Permalink
fix: added defer to close audio file (sashabaranov#195)
Browse files Browse the repository at this point in the history
Co-authored-by: Élison Gomes <elisongomes@users.noreply.github.com>
  • Loading branch information
nosilex and elisongomes committed Mar 23, 2023
1 parent 2ebb265 commit dbb7829
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func audioMultipartForm(request AudioRequest, w *multipart.Writer) error {
if err != nil {
return fmt.Errorf("opening audio file: %w", err)
}
defer f.Close()

fw, err := w.CreateFormFile("file", f.Name())
if err != nil {
Expand Down

0 comments on commit dbb7829

Please sign in to comment.