Skip to content

Commit

Permalink
testcontainers#98 rename cont to c
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Kuznetsov committed Nov 21, 2019
1 parent fbe8f22 commit bed2e88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions canned/postgres/postgres.go
Expand Up @@ -32,16 +32,16 @@ type Container struct {
req ContainerRequest
}

func (cont Container) ConnectURL(ctx context.Context) (string, error) {
func (c Container) ConnectURL(ctx context.Context) (string, error) {
template := "postgres://%s:%s@localhost:%s/%s"

mappedPort, err := cont.Container.MappedPort(ctx, port)
mappedPort, err := c.Container.MappedPort(ctx, port)
if err != nil {
return "", errors.Wrapf(err, "failed to get mapper port for %s", port.Port())
}

return fmt.Sprintf(template, cont.req.User, cont.req.Password,
mappedPort.Port(), cont.req.Database), nil
return fmt.Sprintf(template, c.req.User, c.req.Password,
mappedPort.Port(), c.req.Database), nil
}

func NewContainer(ctx context.Context, req ContainerRequest) (*Container, error) {
Expand Down

0 comments on commit bed2e88

Please sign in to comment.