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

Save memory #26

Merged
merged 2 commits into from
Oct 21, 2017
Merged

Save memory #26

merged 2 commits into from
Oct 21, 2017

Conversation

agatan
Copy link
Owner

@agatan agatan commented Oct 21, 2017

POST /profile で画像をメモリに読み込んでからファイルに書き出している.
むだなので io.Copy でやりたい.
ファイル名が変わるけどレギュレーション的にはセーフだったはず

cc @0gajun

if err != nil {
return err
}
if _, err := io.Copy(dst, f); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

naruhodo

Copy link
Collaborator

@izumin5210 izumin5210 left a comment

Choose a reason for hiding this comment

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

信じている

return err
}
defer dst.Close()
f, err := fh.Open()
Copy link
Collaborator

Choose a reason for hiding this comment

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

fCloseしなくていい?

@agatan
Copy link
Owner Author

agatan commented Oct 21, 2017

f.Close した!

@agatan agatan merged commit 0e160c5 into master Oct 21, 2017
@izumin5210 izumin5210 deleted the agatan/save-memory branch October 21, 2017 07:23
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.

2 participants