Connect to a PostgreSQL database using Go. You can pass the database configuration either as Command-Line Flags or as Environment Variables
go build
This will create a binary file with the name gopq in current directory.
./gopq -h=localhost -p=5432 -db=dbname -u=postgres -pwd=dbpwd -ssl=require
DB_HOST=localhost DB_PORT=5432 DB_NAME=dbname DB_USER=postgres DB_PWD=dbpwd DB_SSL=require ./gopq