You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: soakclient.go
    path of file: ./repos/confluent-kafka-go/soaktest/soakclient
    
    the code of the file until where you have to start completion: /**
 * Copyright 2021 Confluent Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package main

import (
	"context"
	"flag"
	"fmt"
	"os"
	"os/signal"
	"sync"
	"syscall"
	"time"

	soaktest "github.com/confluentinc/confluent-kafka-go/soaktest/v2"

	"github.com/confluentinc/confluent-kafka-go/v2/kafka"
)

const endToEnd = "end.to.end."
const rate = 2
const producerType = "InputProducer"
const consumerType = "OutputConsumer"

func main() {

	broker := flag.String("broker", "", "bootstrap servers")
	inputTopic := flag.String("inputTopic", "inputTopic",
		"producer will deliver messages to this topic")
	outTopic := flag.String("outTopic", "outTopic",
		"consumer will consume messages from this topic")
	groupID := flag.String("groupID", "groupID",
		"the group consumer will join")
	inputTopicPartitionsNum := flag.Int("inputTopicPartitionsNum", 4,
		"inputTopic partition number")
	outTopicPartitionsNum := flag.Int("outTopicPartitionsNum", 4,
		"outTopic parti
    
func main() {

	broker := flag.String("broker", "", "bootstrap servers")
	inputTopic := flag.String("inputTopic", "inputTopic",
		"producer will deliver messages to this topic")
	outTopic := flag.String("outTopic", "outTopic",
		"consumer will consume messages from this topic")
	groupID := flag.String("groupID", "groupID",
		"the group consumer will join")
	inputTopicPartitionsNum := flag.Int("inputTopicPartitionsNum", 4,
		"inputTopic partition number")
	outTopicPartitionsNum := flag.Int("outTopicPartitionsNum", 4,
		"outTopic partition number")
	replicationFactor := flag.Int("replicationFactor", 1, "topic replication")
	ccloudAPIKey := flag.String("ccloudAPIKey", "", "sasl username")
	ccloudAPISecret := flag.String("ccloudAPISecret", "", "sasl password")

	flag.Parse()

	soaktest.InitLogFiles(fmt.Sprintf("../log/soakclient_%s.log",
		time.Now().Format("2006-01-02")))
	soaktest.InfoLogger.Printf("Starting the application...\n")

	num, version := kafka.LibraryVersion()
	soaktest.InfoLogger.Printf("num = %d, librdkafka %q\n", num, version)

	var wg sync.WaitGroup
	doneChan := make(chan bool, 1)
	errorChan := make(chan error, 1)

	wg.Add(1)
	go soaktest.GetRusageMetrics(endToEnd, &wg, doneChan, errorChan)

	maxDuration, err := time.ParseDuration("30s")
	if err != nil {
		soaktest.ErrorLogger.Printf("Failed to create maxDuration with "+
			"err %s\n", err)
		os.Exit(1)
	}
	ctx, cancel := context.WithTimeout(context.Background(), maxDuration)
	defer cancel()

	newTopics := []kafka.TopicSpecification{
		{Topic: *inputTopic,
			NumPartitions:     *inputTopicPartitionsNum,
			ReplicationFactor: *replicationFactor},
		{Topic: *outTopic,
			NumPartitions:     *outTopicPartitionsNum,
			ReplicationFactor: *replicationFactor}}

	err = CreateTopic(ctx, newTopics, *broker, *ccloudAPIKey, *ccloudAPISecret)
	if err != nil {
		soaktest.ErrorLogger.Printf("Failed to create topics: %s\n", err)
		close(doneChan)
		os.Exit(1)
	}

	wg.Add(1)
	go producer(*inputTopic, *broker, *ccloudAPIKey,
		*ccloudAPISecret, &wg, doneChan, errorChan,
		uint64(*inputTopicPartitionsNum))

	wg.Add(1)
	go consumer(*outTopic, *broker, *groupID, *ccloudAPIKey,
		*ccloudAPISecret, &wg, doneChan, errorChan)

	sigChan := make(chan os.Signal, 1)
	signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)

	select {
	case sig := <-sigChan:
		soaktest.InfoLogger.Printf("Signal caught: %v\n", sig)
	case err := <-errorChan:
		soaktest.ErrorLogger.Printf("Error caught: %s\n", err)
	}

	close(doneChan)
	close(errorChan)
	for err = range errorChan {
		soaktest.ErrorLogger.Printf("Error caught: %s\n", err)
	}
	wg.Wait()
	soaktest.PrintConsumerStatus(consumerType)
	soaktest.PrintProducerStatus(producerType)
}