This repo is the completed code of the tutorial Building and Testing a REST API in Go with Gorilla Mux and PostgreSQL
docker run -it -p 5432:5432 -d postgres
Add following lines to ~/.bashrc
export APP_DB_USERNAME=postgres
export APP_DB_PASSWORD=
export APP_DB_NAME=postgres
go test -v
or with the following command if you don't want to export the previous variables
APP_DB_USERNAME=postgres APP_DB_PASSWORD= APP_DB_NAME=postgres go test -v