I have a Go application which uses a Postgres DB on Cloud (Heroku) and sets the DB Url as an environment variable calling the Heroku CLI as per guidelines.
So the app can