code: func (fs *FileSorter) Close() error {
  	if fs.closed {
  		return nil
  	}
  	fs.wg.Wait()
  	for _, w := range fs.workers {
  		w.buf = w.buf[:0]
  	}
  	fs.closed = true
  	err := fs.closeAllFiles()
  	if err != nil {
  		return errors.Trace(err)
  	}
  	return nil
  }
docs: // Close terminates the input or output process and discards all remaining data.