Go Testcontainers for Postgres flavors

A complete example of using Testcontainers for Postgres

- 1 min read

Series: Golang


Source Code of the laboratory. All examples are functional, follow the instructions in the README file for setting up. The csv file is generated by the Docker Compose setup, you can regenerate the example by running docker compose up -d if you need a different data scale.

Testcontainers allows you to test your code with ephemeral containers right inside your tests. It provides different modules for simplifying the process, however, sometimes you many need to customize the container beyond the default parameters or it contents.

This laboratory is an exploratory approach for setting tests that require Postgres services of different kinds.

comments powered by Disqus