Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added defer to close audio file #195

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

nosilex
Copy link
Contributor

@nosilex nosilex commented Mar 23, 2023

This PR solve the above issue:

In some cases, the audio file opened for reading is not closed, making it impossible to remove it.

The f.Close call was added at the end of the execution of the audioMultipartForm function.

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Merging #195 (aac8314) into master (2ebb265) will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
+ Coverage   71.84%   71.94%   +0.09%     
==========================================
  Files          21       21              
  Lines         579      581       +2     
==========================================
+ Hits          416      418       +2     
  Misses        124      124              
  Partials       39       39              
Impacted Files Coverage Δ
audio.go 47.29% <100.00%> (+1.46%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Owner

@sashabaranov sashabaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, thank you!

The audio.go is also ripe for unit testing if you'd be interested.

@sashabaranov sashabaranov merged commit dbb7829 into sashabaranov:master Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants