package main import ( "context" "os" "github.com/jackc/pgx/v4/pgxpool" ) var pool *pgxpool.Pool func getDbPool() *pgxpool.Pool { // Setup Database dburl := os.Getenv("DATABASE_URL") pool, err := pgxpool.Connect(context.Background(), dburl) if err != nil { logFatal("Unable to connect to database:", err) } return pool }