From 9da8b2b431d4780839deb88117903f4863414af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=B4=BA=E5=90=89?= Date: Thu, 16 Jan 2020 17:53:41 +0800 Subject: [PATCH] remove duplicate 'Config.assertInitialized()' check --- consumer.go | 2 -- producer.go | 1 - 2 files changed, 3 deletions(-) diff --git a/consumer.go b/consumer.go index eae55d67..d0c21beb 100644 --- a/consumer.go +++ b/consumer.go @@ -145,8 +145,6 @@ type Consumer struct { // The only valid way to create a Config is via NewConfig, using a struct literal will panic. // After Config is passed into NewConsumer the values are no longer mutable (they are copied). func NewConsumer(topic string, channel string, config *Config) (*Consumer, error) { - config.assertInitialized() - if err := config.Validate(); err != nil { return nil, err } diff --git a/producer.go b/producer.go index c4995dd9..7eb6b462 100644 --- a/producer.go +++ b/producer.go @@ -70,7 +70,6 @@ func (t *ProducerTransaction) finish() { // The only valid way to create a Config is via NewConfig, using a struct literal will panic. // After Config is passed into NewProducer the values are no longer mutable (they are copied). func NewProducer(addr string, config *Config) (*Producer, error) { - config.assertInitialized() err := config.Validate() if err != nil { return nil, err