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 {Event,Op}.Has() #477

Merged
merged 1 commit into from Jul 30, 2022
Merged

Add {Event,Op}.Has() #477

merged 1 commit into from Jul 30, 2022

Commits on Jul 30, 2022

  1. Add {Event,Op}.Has()

    Using:
    
    	if event.Op&fsnotify.Create == fsnotify.Create {
    	}
    
    is overly verbose and awkward; a Has() method makes this much nicer:
    
    	if event.Has(fsnotify.Create) {
    	}
    
    PR #76 was previously rejected; I think that HasCreate() etc. is
    overkill, but a Has() method makes the library quite a bit more
    convenient IMO.
    
    I added it to both the Event and Op to avoid confusion; with this we can
    change the Op field to be private in a future v2.
    
    Fixes #107
    arp242 committed Jul 30, 2022
    Copy the full SHA
    e64ede1 View commit details
    Browse the repository at this point in the history