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 response body read and close defer order #272

Merged
merged 1 commit into from
Jun 14, 2022
Merged

Conversation

souleb
Copy link
Member

@souleb souleb commented Jun 14, 2022

Deferred function calls are executed in Last In First Out order after the surrounding function returns, so we should make sure io.Copy() is executed before close().

Signed-off-by: Soule BA [email protected]

Deferred function calls are executed in Last In First Out order after
the surrounding function returns, so we should make sure io.Copy() is
executed before close()

Signed-off-by: Soule BA <[email protected]>
@souleb souleb requested a review from somtochiama June 14, 2022 10:24
@stefanprodan stefanprodan changed the title Change response body read and close defer order Fix response body read and close defer order Jun 14, 2022
@stefanprodan stefanprodan merged commit 5ab6137 into fluxcd:main Jun 14, 2022
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