code: func (b *Broker) PartitionCount(topic string) (int32, error) {
  	b.mu.Lock()
  	defer b.mu.Unlock()
  
  	count, ok := b.metadata.partitions[topic]
  	if ok {
  		return count, nil
  	}
  
  	return 0, fmt.Errorf("topic %s not found in metadata", topic)
  }
docs: // PartitionCount returns how many partitions a given topic has. If a topic
  // is not known, 0 and an error are returned.