code: func initDB(ldb *leveldb.DB) error {
  	// The starting block file write cursor location is file num 0, offset
  	// 0.
  	batch := new(leveldb.Batch)
  	batch.Put(bucketizedKey(metadataBucketID, writeLocKeyName),
  		serializeWriteRow(0, 0))
  
  	// Create block index bucket and set the current bucket id.
  	//
  	// NOTE: Since buckets are virtualized through the use of prefixes,
  	// there is no need to store the bucket index data for the metadata
  	// bucket in the database.  However, the first bucket ID to use does
  	// need to account for it to ensure there are no key collisions.
  	batch.Put(bucketIndexKey(metadataBucketID, blockIdxBucketName),
  		blockIdxBucketID[:])
  	batch.Put(curBucketIDKeyName, blockIdxBucketID[:])
  
  	// Write everything as a single batch.
  	if err := ldb.Write(batch, nil); err != nil {
  		str := fmt.Sprintf("failed to initialize metadata database: %v",
  			err)
  		return convertErr(str, err)
  	}
  
  	return nil
  }
docs: // initDB creates the initial buckets and values used by the package.  This is
  // mainly in a separate function for testing purposes.