code: func (fsh *Handler) Watch(paths []string, onEvent func(event fsnotify.Event), onClose func()) error {
  	var err error
  	fsh.watcher, err = fsnotify.NewWatcher()
  	if err != nil {
  		return errors.Errorf("failed to init fileDB file system watcher: %v", err)
  	}
  	for _, path := range paths {
  		fsh.watcher.Add(path)
  	}
  
  	go func() {
  		for {
  			select {
  			case event, ok := <-fsh.watcher.Events:
  				if !ok {
  					onClose()
  					return
  				}
  				onEvent(event)
  			case err := <-fsh.watcher.Errors:
  				if err != nil {
  					fsh.log.Errorf("filesystem notification error %v", err)
  				}
  			}
  		}
  	}()
  
  	return nil
  }
docs: // Watch starts new filesystem notification watcher. All events from files are passed to 'onEvent' function.
  // Function 'onClose' is called when event channel is closed.