code: func (w *IndexWriter) assertFilesExist(toSync *SegmentInfos) error {
  	files := toSync.files(w.directory, false)
  	for _, filename := range files {
  		allFiles, err := w.directory.ListAll()
  		if err != nil {
  			return err
  		}
  		ok, err := w.slowFileExists(w.directory, filename)
  		if err != nil {
  			return err
  		}
  		assert2(ok, "file %v does not exist; files=%v", filename, allFiles)
  		// If this trips it means we are missing a call to checkpoint
  		// somewhere, because by the time we are called, deleter should
  		// know about every file referenced by the current head
  		// segmentInfos:
  		assert2(w.deleter.exists(filename), "IndexFileDeleter doesn't know about file %v", filename)
  	}
  	return nil
  }
docs: // called only from assert