Skip to content

Commit

Permalink
exampels: indent with spaces on Cassandra example (#88)
Browse files Browse the repository at this point in the history
Signed-off-by: Calvin Leung Huang <[email protected]>
  • Loading branch information
calvn authored and arekkas committed Apr 10, 2017
1 parent f0e8b64 commit 0eb2fe9
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions examples/Cassandra.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ if err != nil {
}

options := &dockertest.RunOptions{
Repository: "cassandra",
Tag: "latest",
Mounts: []string{"/tmp/local-cassandra:/etc/cassandra"},
}
Repository: "cassandra",
Tag: "latest",
Mounts: []string{"/tmp/local-cassandra:/etc/cassandra"},
}

resource, err := pool.RunWithOptions(options)
if err != nil {
Expand All @@ -23,21 +23,21 @@ port, _ := strconv.Atoi(resource.GetPort("9042/tcp"))

// exponential backoff-retry, because the application in the container might not be ready to accept connections yet
if err := pool.Retry(func() error {
clusterConfig := gocql.NewCluster(retURL)
clusterConfig.Authenticator = gocql.PasswordAuthenticator{
Username: "cassandra",
Password: "cassandra",
}
clusterConfig.ProtoVersion = 4
clusterConfig.Port = port
log.Printf("%v", clusterConfig.Port)
clusterConfig := gocql.NewCluster(retURL)
clusterConfig.Authenticator = gocql.PasswordAuthenticator{
Username: "cassandra",
Password: "cassandra",
}
clusterConfig.ProtoVersion = 4
clusterConfig.Port = port
log.Printf("%v", clusterConfig.Port)

session, err := clusterConfig.CreateSession()
if err != nil {
return fmt.Errorf("error creating session: %s", err)
}
session, err := clusterConfig.CreateSession()
if err != nil {
return fmt.Errorf("error creating session: %s", err)
}
defer session.Close()
return nil
return nil
}); err != nil {
log.Fatalf("Could not connect to docker: %s", err)
}
Expand Down

0 comments on commit 0eb2fe9

Please sign in to comment.