From fbdfccf1f91a4c0bc042cb37f3c7c2c9e27a4877 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 30 Mar 2019 12:55:56 -0500 Subject: [PATCH] Use Go modules --- .gitignore | 1 + benchmark_test.go | 2 +- config.go | 2 +- config_test.go | 2 +- go.mod | 11 +++++++++++ go.sum | 19 +++++++++++++++++++ helper_test.go | 2 +- pgconn.go | 6 +++--- pgconn_stress_test.go | 2 +- pgconn_test.go | 4 ++-- 10 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 go.mod create mode 100644 go.sum diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..7a6353d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.envrc diff --git a/benchmark_test.go b/benchmark_test.go index d2576324..959e86be 100644 --- a/benchmark_test.go +++ b/benchmark_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/jackc/pgx/pgconn" + "github.com/jackc/pgconn" "github.com/stretchr/testify/require" ) diff --git a/config.go b/config.go index fec1fedf..1cde9c57 100644 --- a/config.go +++ b/config.go @@ -17,7 +17,7 @@ import ( "strings" "time" - "github.com/jackc/pgx/pgpassfile" + "github.com/jackc/pgpassfile" "github.com/pkg/errors" ) diff --git a/config_test.go b/config_test.go index c7b65861..ce6f3957 100644 --- a/config_test.go +++ b/config_test.go @@ -8,7 +8,7 @@ import ( "os/user" "testing" - "github.com/jackc/pgx/pgconn" + "github.com/jackc/pgconn" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..3dc806a4 --- /dev/null +++ b/go.mod @@ -0,0 +1,11 @@ +module github.com/jackc/pgconn + +go 1.12 + +require ( + github.com/jackc/pgio v1.0.0 + github.com/jackc/pgpassfile v1.0.0 + github.com/jackc/pgproto3 v1.0.0 + github.com/pkg/errors v0.8.1 + github.com/stretchr/testify v1.3.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..5b6f835b --- /dev/null +++ b/go.sum @@ -0,0 +1,19 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v0.0.0-20190330174656-bb06e6b3ff87 h1:xueDi0R+HxuFmuOA1xyFbbF+2LSXqWQJZSPWmmMFB0A= +github.com/jackc/pgproto3 v0.0.0-20190330174656-bb06e6b3ff87/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3 v1.0.0 h1:25tUmlES7eyD96oYaUHc1dLOFbgcJtFzCdnOOoqmA1I= +github.com/jackc/pgproto3 v1.0.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/helper_test.go b/helper_test.go index c5ac6e01..5d44f3b8 100644 --- a/helper_test.go +++ b/helper_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/jackc/pgx/pgconn" + "github.com/jackc/pgconn" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pgconn.go b/pgconn.go index c785f367..6490617a 100644 --- a/pgconn.go +++ b/pgconn.go @@ -15,8 +15,8 @@ import ( "sync" "time" - "github.com/jackc/pgx/pgio" - "github.com/jackc/pgx/pgproto3" + "github.com/jackc/pgio" + "github.com/jackc/pgproto3" ) var deadlineTime = time.Date(1, 1, 1, 1, 1, 1, 1, time.UTC) @@ -171,7 +171,7 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig } } - pgConn.Frontend, err = pgproto3.NewFrontend(pgConn.conn, pgConn.conn) + pgConn.Frontend, err = pgproto3.NewFrontend(pgproto3.NewChunkReader(pgConn.conn), pgConn.conn) if err != nil { return nil, err } diff --git a/pgconn_stress_test.go b/pgconn_stress_test.go index 7a95fa98..1ebbe04a 100644 --- a/pgconn_stress_test.go +++ b/pgconn_stress_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/jackc/pgx/pgconn" + "github.com/jackc/pgconn" "github.com/stretchr/testify/require" ) diff --git a/pgconn_test.go b/pgconn_test.go index dbf9b840..716761ad 100644 --- a/pgconn_test.go +++ b/pgconn_test.go @@ -15,8 +15,8 @@ import ( "testing" "time" - "github.com/jackc/pgx/pgconn" - "github.com/jackc/pgx/pgproto3" + "github.com/jackc/pgconn" + "github.com/jackc/pgproto3" "github.com/pkg/errors" "github.com/stretchr/testify/assert"