BewareMyPower commented on code in PR #1437:
URL: https://github.com/apache/pulsar-client-go/pull/1437#discussion_r2536148894
##########
pulsar/producer_impl.go:
##########
@@ -319,12 +315,26 @@ func (p *producer) getPartition(msg *ProducerMessage)
Producer {
return producers[partition]
}
+func (p *producer) getProducers() []Producer {
+ if producers := p.producers.Load(); producers != nil {
+ return producers.([]Producer)
+ }
+ return []Producer{}
Review Comment:
It's better to panic here. Otherwise, method call like
`getProducer(partition)` could also panic but it's hard to see if it's caused
by the out of range of `partition`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]