2
0

Use environment variables for test configuration

This commit is contained in:
Jack Christensen
2018-12-30 21:52:33 -06:00
parent 67a15e6f7f
commit c672c0d595
22 changed files with 245 additions and 253 deletions
+2 -1
View File
@@ -3,12 +3,13 @@ package pgx_test
import (
"context"
"fmt"
"os"
"github.com/jackc/pgx"
)
func Example_JSON() {
conn, err := pgx.ConnectConfig(context.Background(), defaultConnConfig)
conn, err := pgx.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
if err != nil {
fmt.Printf("Unable to establish connection: %v", err)
return