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

Make sure to invoke CancelFunc in all cases #145

Merged
merged 1 commit into from May 3, 2020
Merged

Make sure to invoke CancelFunc in all cases #145

merged 1 commit into from May 3, 2020

Conversation

hibiken
Copy link
Owner

@hibiken hibiken commented May 3, 2020

From context package overview:

The WithCancel, WithDeadline, and WithTimeout functions take a Context (the parent) and return a derived Context (the child) and a CancelFunc. Calling the CancelFunc cancels the child and its children, removes the parent's reference to the child, and stops any associated timers. Failing to call the CancelFunc leaks the child and its children until the parent is canceled or the timer fires. The go vet tool checks that CancelFuncs are used on all control-flow paths.

@codecov
Copy link

codecov bot commented May 3, 2020

Codecov Report

Merging #145 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #145   +/-   ##
=======================================
  Coverage   85.91%   85.92%           
=======================================
  Files          15       15           
  Lines        1441     1442    +1     
=======================================
+ Hits         1238     1239    +1     
  Misses        129      129           
  Partials       74       74           
Impacted Files Coverage Δ
processor.go 91.74% <100.00%> (+0.04%) ⬆️

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 1c1474c...8356218. Read the comment docs.

@hibiken hibiken merged commit 24f2b64 into master May 3, 2020
@hibiken hibiken deleted the fix/context branch May 3, 2020 22:58
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

1 participant