-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add errgroupcheck linter #4891
base: master
Are you sure you want to change the base?
Add errgroupcheck linter #4891
Conversation
Hey, thank you for opening your first Pull Request ! |
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements.
Pull Request Description
Linter
The Linter Tests Inside Golangci-lint
|
Another yet case for uncalled |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Can you help me understand this?
The only config available is to enable / disable the sole rule currently implemented. Should I change the Default to be errgroupcheck:
# Check if any sync.errgroup.Group instance is missing a call to the Wait() func.
# Default: true
require-wait: true |
The "# Default:" should be the default value. # Default: true
require-wait: false |
Does the longer work for errgroups stored as struct attribute? |
errgroupcheck analyzes code and reports any usage of
golang.org/x/sync/errgroup
that is missing any call to theWait()
func.All the examples reported in the errgroup documentation showcase the correct usage of the
Wait()
func to wait for all the coroutines to complete before proceeding.Missing the
Wait()
call allows the code to compile just fine, but yields unexpected results due to the coroutines running without any wait for termination.