no require return the painc behind

pull/333/head
yangzhen 3 years ago
parent e2c53754b5
commit 4ec01fcf1d

@ -28,14 +28,12 @@ func NewKafkaConsumer(addr []string, topic string) *Consumer {
consumer, err := sarama.NewConsumer(p.addr, consumerConfig)
if err != nil {
panic(err.Error())
return nil
}
p.Consumer = consumer
partitionList, err := consumer.Partitions(p.Topic)
if err != nil {
panic(err.Error())
return nil
}
p.PartitionList = partitionList

@ -37,7 +37,6 @@ func NewKafkaProducer(addr []string, topic string) *Producer {
producer, err := sarama.NewSyncProducer(p.addr, p.config) //Initialize the client
if err != nil {
panic(err.Error())
return nil
}
p.producer = producer
return &p

Loading…
Cancel
Save