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

Return ErrClosed on Add() when the watcher is closed #516

Merged
merged 1 commit into from Oct 13, 2022
Merged

Conversation

arp242
Copy link
Member

@arp242 arp242 commented Oct 13, 2022

Also consistently return nil for Remove() and WatchList(). For Remove() we could return an error, but I don't really see the point: if the watcher is closed it's basically a no-op so returning nil is fine.

For WatchList() I'd like to return an error, but there is no error return, so explicitly returning nil is the best we can do.

Fixes #511

@arp242 arp242 requested a review from a team October 13, 2022 02:25
@arp242
Copy link
Member Author

arp242 commented Oct 13, 2022

CI failures are unrelated to this PR.

Copy link
Contributor

@nshalman nshalman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, but this seems reasonable to me.
Thanks for fixing the illumos CI!

fsnotify_test.go Outdated Show resolved Hide resolved
backend_windows.go Outdated Show resolved Hide resolved
Also consistently return nil for Remove() and WatchList(). For Remove()
we could return an error, but I don't really see the point: if the
watcher is closed it's basically a no-op so returning nil is fine.

For WatchList() I'd like to return an error, but there is no error
return, so explicitly returning nil is the best we can do.

Fixes #511
@arp242 arp242 merged commit ac3d3a5 into main Oct 13, 2022
@arp242 arp242 deleted the close-err branch October 13, 2022 18:17
@shogo82148 shogo82148 mentioned this pull request Mar 6, 2024
25 tasks
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.

Make watcher isClosed public
2 participants