This is an automated email from the ASF dual-hosted git repository.
mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new 9620e75 Set error only if not nil (#105)
9620e75 is described below
commit 9620e75d0b0bfaff9b2df160bac4728873e7b281
Author: Reugn <[email protected]>
AuthorDate: Tue Nov 26 21:33:13 2019 +0200
Set error only if not nil (#105)
---
pulsar/impl_producer.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pulsar/impl_producer.go b/pulsar/impl_producer.go
index c1a9902..6054402 100644
--- a/pulsar/impl_producer.go
+++ b/pulsar/impl_producer.go
@@ -91,7 +91,9 @@ func newProducer(client *client, options *ProducerOptions)
(*producer, error) {
for i := 0; i < numPartitions; i++ {
pe, ok := <-c
if ok {
- err = pe.err
+ if pe.err != nil {
+ err = pe.err
+ }
p.producers[pe.partition] = pe.prod
}
}