Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

tcgriffith
Copy link

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

@codecov
Copy link

codecov bot commented Jan 15, 2020

Codecov Report

Merging #1481 into master will increase coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e8a797...7245546. Read the comment docs.

@fvln
Copy link

fvln commented Jan 15, 2020

Indeed, PR #1438 had a typo! I then submitted PR #1439 which went stale just a few days ago.
I hope your PR will be merged to fix this issue :)

@tcgriffith
Copy link
Author

tcgriffith commented Jan 15, 2020

Indeed, PR #1438 had a typo! I then submitted PR #1439 which went stale just a few days ago.
I hope your PR will be merged to fix this issue :)

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

@fvln
Copy link

fvln commented Jan 15, 2020

Please keep it open, at leat it's fresh ;-)
Thanks for the tip, I didn't know that!

@@ -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()

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?

Copy link
Author

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?

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.

@tcgriffith
Copy link
Author

Closing, fixed in PR #1515

@tcgriffith tcgriffith closed this Mar 3, 2020
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