Skip to content

Commit

Permalink
run go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinlindemberg committed Sep 25, 2021
1 parent 40e6591 commit 3aba387
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions canned/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
package canned

import (
"context"
"github.com/testcontainers/testcontainers-go"
"io/ioutil"
"os"
"context"
"github.com/testcontainers/testcontainers-go"
"io/ioutil"
"os"
)

const (
clusterName = "kafka-cluster"
zookeeperPort = "2181"
clusterName = "kafka-cluster"
zookeeperPort = "2181"
kafkaBrokerPort = "9092"
kafkaClientPort = "9093"
zookeeperImage = "confluentinc/cp-zookeeper:5.2.1"
kafkaImage = "confluentinc/cp-kafka:5.2.1"
zookeeperImage = "confluentinc/cp-zookeeper:5.2.1"
kafkaImage = "confluentinc/cp-kafka:5.2.1"
)

type KafkaCluster struct {
kafkaContainer testcontainers.Container
kafkaContainer testcontainers.Container
zookeeperContainer testcontainers.Container
}

Expand Down Expand Up @@ -90,7 +90,7 @@ func NewKafkaCluster() *KafkaCluster {

return &KafkaCluster{
zookeeperContainer: zookeeperContainer,
kafkaContainer: kafkaContainer,
kafkaContainer: kafkaContainer,
}
}

Expand Down Expand Up @@ -133,7 +133,7 @@ func createKafkaContainer(network *testcontainers.DockerNetwork) testcontainers.
Networks: []string{network.Name},
NetworkAliases: map[string][]string{network.Name: {"kafka"}},
// the container only starts when it finds and run /testcontainers_start.sh
Cmd: []string{"sh", "-c", "while [ ! -f /testcontainers_start.sh ]; do sleep 0.1; done; /testcontainers_start.sh"},
Cmd: []string{"sh", "-c", "while [ ! -f /testcontainers_start.sh ]; do sleep 0.1; done; /testcontainers_start.sh"},
},
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion canned/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func produceKafkaMessages(kafkaServer string, messages []string) {
kafkaProducer.Produce(&kafka.Message{
TopicPartition: kafka.TopicPartition{Topic: &topic, Partition: kafka.PartitionAny},
Value: []byte(word),
Key: []byte("key"),
Key: []byte("key"),
}, deliveryChan)

e := <-deliveryChan
Expand Down

0 comments on commit 3aba387

Please sign in to comment.