Skip to content

Commit 9a023d4

Browse files
committed
Refactor cgomap setup
1 parent 79fa6ef commit 9a023d4

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

kafka/consumer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ func NewConsumer(conf *ConfigMap) (*Consumer, error) {
292292

293293
c.handle.c = c
294294
c.handle.setup()
295-
c.handle.cgomap = make(map[int]cgoif)
296295
c.handle.rkq = C.rd_kafka_queue_get_consumer(c.handle.rk)
297296
if c.handle.rkq == nil {
298297
// no cgrp (no group.id configured), revert to main queue.

kafka/handle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (h *handle) String() string {
8080
func (h *handle) setup() {
8181
h.rktCache = make(map[string]*C.rd_kafka_topic_t)
8282
h.rktNameCache = make(map[*C.rd_kafka_topic_t]string)
83-
83+
h.cgomap = make(map[int]cgoif)
8484
h.terminatedChan = make(chan string, 10)
8585
}
8686

kafka/producer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ func NewProducer(conf *ConfigMap) (*Producer, error) {
241241
p.handle.p = p
242242
p.handle.setup()
243243
p.handle.rkq = C.rd_kafka_queue_get_main(p.handle.rk)
244-
p.handle.cgomap = make(map[int]cgoif)
245244
p.Events = make(chan Event, 1000000)
246245
p.ProduceChannel = make(chan *Message, produceChannelSize)
247246
p.pollerTermChan = make(chan bool)

0 commit comments

Comments
 (0)