code: func waitForFile(p string, to time.Duration) []error {
  	done := time.After(to)
  	for {
  		select {
  		case <-done:
  			return []error{
  				fmt.Errorf("timed out waiting for %s", p),
  			}
  		case <-time.After(1):
  			if ok, _ := fileExists(p); ok {
  				return nil
  			}
  		}
  	}
  }
docs: // waitForFile waits for the file at the given path to appear