code: func NewClient(config *Config, partitioner string) (sarama.Client, error) {
  	config.Logger.Debug("Creating new consumer")
  	if err := config.ValidateAsyncProducerConfig(); err != nil {
  		return nil, err
  	}
  
  	config.SetSendSuccess(true)
  	config.SetSuccessChan(make(chan *ProducerMessage))
  	config.SetSendError(true)
  	config.SetErrorChan(make(chan *ProducerError))
  	// Required acks will be set in sync/async producer
  	config.RequiredAcks = AcksUnset
  
  	// set other Producer config params
  	config.ProducerConfig().Producer.Return.Successes = config.SendSuccess
  	config.ProducerConfig().Producer.Return.Errors = config.SendError
  
  	// set partitioner
  	switch partitioner {
  	case Hash:
  		config.ProducerConfig().Producer.Partitioner = sarama.NewHashPartitioner
  	case Random:
  		config.ProducerConfig().Producer.Partitioner = sarama.NewRandomPartitioner
  	case Manual:
  		config.ProducerConfig().Producer.Partitioner = sarama.NewManualPartitioner
  	default:
  		// Hash partitioner is set as default
  		config.ProducerConfig().Producer.Partitioner = sarama.NewHashPartitioner
  	}
  
  	config.Logger.Debugf("AsyncProducer config: %#v", config)
  
  	sClient, err := sarama.NewClient(config.Brokers, &config.Config.Config)
  	if err != nil {
  		fmt.Printf("Error creating consumer client %v", err)
  		return nil, err
  	}
  
  	return sClient, nil
  }
docs: // NewClient initializes new sarama client instance from provided config and with defined partitioner