code: func (c *vppClient) WaitReady() error {
  	// check if file at the path already exists
  	if _, err := os.Stat(c.sockAddr); err == nil {
  		return nil
  	} else if os.IsExist(err) {
  		return err
  	}
  
  	// if not, watch for it
  	watcher, err := fsnotify.NewWatcher()
  	if err != nil {
  		return err
  	}
  	defer func() {
  		if err := watcher.Close(); err != nil {
  			Log.Errorf("failed to close file watcher: %v", err)
  		}
  	}()
  
  	// start watching directory
  	if err := watcher.Add(filepath.Dir(c.sockAddr)); err != nil {
  		return err
  	}
  
  	for {
  		select {
  		case <-time.After(MaxWaitReady):
  			return fmt.Errorf("waiting for socket file timed out (%s)", MaxWaitReady)
  		case e := <-watcher.Errors:
  			return e
  		case ev := <-watcher.Events:
  			Log.Debugf("watcher event: %+v", ev)
  			if ev.Name == c.sockAddr {
  				if (ev.Op & fsnotify.Create) == fsnotify.Create {
  					// socket was created, we are ready
  					return nil
  				}
  			}
  		}
  	}
  }
docs: // WaitReady checks socket file existence and waits for it if necessary