mirror of https://github.com/jackc/pgx.git
18 lines
309 B
Go
18 lines
309 B
Go
package pgconn_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/jackc/pgx/pgconn"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func closeConn(t testing.TB, conn *pgconn.PgConn) {
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
|
defer cancel()
|
|
require.Nil(t, conn.Close(ctx))
|
|
}
|