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

Add err handling in Glob func #37

Merged
merged 1 commit into from
Oct 17, 2020
Merged

Conversation

mszostok
Copy link
Contributor

@mszostok mszostok commented Oct 17, 2020

Description
Hi, thanks for developing that lib, it's really helpful!

But recently I spot one problem and IMO is worth to fix it :)

Currently, the error returned from FastWalk is ignored. This may lead to strange behavior. The path traversing is done in a non-deterministic way if the is more workes, you can end up with a behavior that sometimes the pattern is found and sometimes not as it depends on when it will exit the loop with an error. You as a lib user, you do not know what is the issue because the underlying error is not returned.

This pull request fixes this issue and adds a test to coverage for that scenario. Unfortunately, I was not able to add it to the common testGlobs cases as adding a fixture with wrong permission affects other test cases.

@mattn mattn merged commit 70beb52 into mattn:master Oct 17, 2020
@mattn
Copy link
Owner

mattn commented Oct 17, 2020

Thank you

@mszostok mszostok deleted the fix-err-handling branch October 17, 2020 02:37
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

2 participants