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: call defer in for loop #2411

Merged
merged 1 commit into from
Oct 18, 2022
Merged

Conversation

demoManito
Copy link
Member

Description (what this PR does / why we need it):

Resource leakage may occur. Call 'defer' in the 'for' loop.
case: https://go.dev/doc/effective_go#defer

Which issue(s) this PR fixes (resolves / be part of):

Other special notes for the reviewers:

Resource leakage may occur. Call 'defer' in the 'for' loop.
case: https://go.dev/doc/effective_go#defer
@demoManito demoManito changed the title fix: in for defer close fix: call defer in for loop Sep 28, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2022

Codecov Report

Merging #2411 (41ca554) into main (0ecc2b4) will increase coverage by 0.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2411      +/-   ##
==========================================
+ Coverage   85.31%   85.36%   +0.05%     
==========================================
  Files          88       88              
  Lines        3765     3765              
==========================================
+ Hits         3212     3214       +2     
+ Misses        386      384       -2     
  Partials      167      167              
Impacted Files Coverage Δ
internal/context/context.go 100.00% <0.00%> (+2.98%) ⬆️

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

@tonybase tonybase merged commit 6bb3ad6 into go-kratos:main Oct 18, 2022
xiongpan828 pushed a commit to xiongpan828/kratos that referenced this pull request Jan 5, 2023
Resource leakage may occur. Call 'defer' in the 'for' loop.
case: https://go.dev/doc/effective_go#defer
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.

None yet

3 participants