Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

[dc-rules] add check defer call cancelFunc after context.WithCancel #60

Open
peakle opened this issue Jun 21, 2022 · 0 comments
Open

[dc-rules] add check defer call cancelFunc after context.WithCancel #60

peakle opened this issue Jun 21, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@peakle
Copy link
Member

peakle commented Jun 21, 2022

Is your feature request related to a problem? Please describe.
to prevent goroutines leak check for cancelFunc defer call (from context.WithCancel)

Describe the solution you'd like
add new rule for cancelFunc call after creation

Code example(s) or test data

ctx, cancel := context.WithCancel(context.Background())
defer cancel() <- expect warning if line doesn't exist
@peakle peakle added enhancement New feature or request good first issue Good for newcomers labels Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant