code: func (c *dbCache) Close() error {
  	// Flush any outstanding cached entries to disk.
  	if err := c.flush(); err != nil {
  		// Even if there is an error while flushing, attempt to close
  		// the underlying database.  The error is ignored since it would
  		// mask the flush error.
  		_ = c.ldb.Close()
  		return err
  	}
  
  	// Close the underlying leveldb database.
  	if err := c.ldb.Close(); err != nil {
  		str := "failed to close underlying leveldb database"
  		return convertErr(str, err)
  	}
  
  	return nil
  }
docs: // Close cleanly shuts down the database cache by syncing all data and closing
  // the underlying leveldb database.
  //
  // This function MUST be called with the database write lock held.