FAQ
Use Docker to run your Go language integration tests against persistent
data storage services like *MySQL, Postgres or MongoDB*.
Dockertest also supports docker-machine if you're developing on OSX or
Windows.

It's as simple as:

c, ip, port, _ := dockertest.SetupPostgreSQLContainer()
defer c.KillRemove()

url := fmt.Sprintf(
     "postgres://%s:%s@%s:%d/",
     dockertest.PostgresUsername,
     dockertest.PostgresPassword,
     ip, port,
)

db, err := sql.Open("postgres", url)

*Check it out at https://github.com/ory-am/dockertest
<https://github.com/ory-am/dockertest>*

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 4, '15 at 1:24p
activeNov 4, '15 at 1:24p
posts1
users1
websitegolang.org

1 user in discussion

Machete143: 1 post

People

Translate

site design / logo © 2021 Grokbase