+
Skip to content

wg.Add(1) should be done outside the go function. #44

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

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

arjenlentz
Copy link
Contributor

The Go implementation of simplegrep didn't work. I fixed it by moving the wg.Add() call which should be outside of the go routine (as per the waitgroup docs). It was a finicky one to catch as the program would just complete with 0 files scanned.

@flier flier merged commit 7be5d40 into flier:master Aug 1, 2022
@flier
Copy link
Owner

flier commented Aug 1, 2022

Thanks

@arjenlentz arjenlentz deleted the arjenlentz-simplegrep-wgadd branch August 5, 2022 06:23
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.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载