-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Apply the fix in #1435, introduced by #1411 but not fixed in #1438 #1481
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1481 +/- ##
==========================================
+ Coverage 84.83% 84.92% +0.08%
==========================================
Files 28 28
Lines 2163 2162 -1
==========================================
+ Hits 1835 1836 +1
+ Misses 213 212 -1
+ Partials 115 114 -1 Continue to review full report at Codecov.
|
Didn't see that pr earlier, sorry. I'm fine to close this pr for #1439 . I would like to remind you that you can commit to the same PR after the request, instead of opening a new PR |
Please keep it open, at leat it's fresh ;-) |
@@ -352,7 +352,9 @@ func (c *context) FormParams() (url.Values, error) { | |||
|
|||
func (c *context) FormFile(name string) (*multipart.FileHeader, error) { | |||
f, fh, err := c.request.FormFile(name) | |||
defer f.Close() | |||
if f != nil { | |||
defer f.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Is it better to just close the file without defer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Should I remove defer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should. Because this version is a bit confusing.
Closing, fixed in PR #1515 |
Had the same issue as in #1435, Tested the proposed fix by @fvln and it worked perfectly.
but in the PR #1438, the code was not the proposed one.
All credits should go to @fvln