File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -180,3 +180,8 @@ func (l *Listener) ClearWatch() error {
180180func (actions Action ) Has (a Action ) bool {
181181 return actions & a == a
182182}
183+
184+ // Or appends the specified action to the set of actions to watch for
185+ func (actions Action ) Or (a Action ) Action {
186+ return actions | a
187+ }
Original file line number Diff line number Diff line change @@ -373,3 +373,11 @@ func TestWithCapSysAdmFanotifyFileOrDirDeleted(t *testing.T) {
373373 assert .True (t , event .Actions .Has (FileDeleted ))
374374 }
375375}
376+
377+ func TestActions (t * testing.T ) {
378+ var actions Action
379+ actions = FileCreated .Or (FileModified .Or (FileDeleted ))
380+ assert .True (t , actions .Has (FileCreated ))
381+ assert .True (t , actions .Has (FileModified ))
382+ assert .True (t , actions .Has (FileDeleted ))
383+ }
You can’t perform that action at this time.
0 commit comments