code: func (p *Partition) Close() error {
  	// Wait for goroutines to finish outstanding compactions.
  	p.once.Do(func() {
  		close(p.closing)
  		close(p.compactionInterrupt)
  	})
  	p.wg.Wait()
  
  	// Lock index and close remaining
  	p.mu.Lock()
  	defer p.mu.Unlock()
  
  	var err error
  
  	// Close log files.
  	for _, f := range p.fileSet.files {
  		if localErr := f.Close(); localErr != nil {
  			err = localErr
  		}
  	}
  	p.fileSet.files = nil
  
  	return err
  }
docs: // Close closes the index.