Repository: calcite-avatica-go Updated Branches: refs/heads/master 351a1d0f9 -> c016e6440
[CALCITE-2544] Replace golang.org/x/net/context with stdlib context Project: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/commit/c016e644 Tree: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/tree/c016e644 Diff: http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/diff/c016e644 Branch: refs/heads/master Commit: c016e6440bed51057e83d5178c769f582d685e11 Parents: 351a1d0 Author: Francis Chuang <[email protected]> Authored: Mon Sep 10 21:45:17 2018 +1000 Committer: Francis Chuang <[email protected]> Committed: Mon Sep 10 21:45:17 2018 +1000 ---------------------------------------------------------------------- Gopkg.lock | 19 +++---------------- Gopkg.toml | 4 ---- connection.go | 2 +- driver.go | 2 +- go.mod | 2 +- go.sum | 3 ++- http_client.go | 7 ++++--- rows.go | 2 +- statement.go | 2 +- transaction.go | 3 ++- 10 files changed, 16 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/Gopkg.lock ---------------------------------------------------------------------- diff --git a/Gopkg.lock b/Gopkg.lock index cbca26e..f54cafa 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,11 +11,11 @@ [[projects]] branch = "master" - digest = "1:354978aad16c56c27f57e5b152224806d87902e4935da3b03e18263d82ae77aa" + digest = "1:12ed7dcca9531e58c65cdadb8af0052724bef7fa1581380523fb9cb1215faf0d" name = "github.com/hashicorp/go-uuid" packages = ["."] pruneopts = "UT" - revision = "27454136f0364f2d44b1276c552d69105cf8c498" + revision = "de160f5c59f693fed329e73e291bb751fe4ea4dc" [[projects]] branch = "master" @@ -45,18 +45,7 @@ "pbkdf2", ] pruneopts = "UT" - revision = "614d502a4dac94afa3a6ce146bd1736da82514c6" - -[[projects]] - branch = "master" - digest = "1:d6b719875cf8091fbab38527d81d34e71f4521b9ee9ccfbd4a32cff2ac5af96e" - name = "golang.org/x/net" - packages = [ - "context", - "context/ctxhttp", - ] - pruneopts = "UT" - revision = "8a410e7b638dca158bf9e766925842f6651ff828" + revision = "0709b304e793a5edb4a2c0145f281ecdc20838a4" [[projects]] digest = "1:c902038ee2d6f964d3b9f2c718126571410c5d81251cbab9fe58abd37803513c" @@ -129,8 +118,6 @@ "github.com/golang/protobuf/proto", "github.com/hashicorp/go-uuid", "github.com/xinsnake/go-http-digest-auth-client", - "golang.org/x/net/context", - "golang.org/x/net/context/ctxhttp", "gopkg.in/jcmturner/gokrb5.v5/client", "gopkg.in/jcmturner/gokrb5.v5/config", "gopkg.in/jcmturner/gokrb5.v5/credentials", http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/Gopkg.toml ---------------------------------------------------------------------- diff --git a/Gopkg.toml b/Gopkg.toml index f0ae2ae..39ebede 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -34,10 +34,6 @@ version = "0.4.0" [[constraint]] - branch = "master" - name = "golang.org/x/net" - -[[constraint]] name = "gopkg.in/jcmturner/gokrb5.v5" version = "5.3.0" http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/connection.go ---------------------------------------------------------------------- diff --git a/connection.go b/connection.go index 760e393..3cc9c04 100644 --- a/connection.go +++ b/connection.go @@ -18,11 +18,11 @@ package avatica import ( + "context" "database/sql/driver" "github.com/apache/calcite-avatica-go/v3/errors" "github.com/apache/calcite-avatica-go/v3/message" - "golang.org/x/net/context" ) type conn struct { http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/driver.go ---------------------------------------------------------------------- diff --git a/driver.go b/driver.go index 5f4d8e1..a9d60fb 100644 --- a/driver.go +++ b/driver.go @@ -32,6 +32,7 @@ See https://calcite.apache.org/avatica/go_client_reference.html for more details package avatica import ( + "context" "database/sql" "database/sql/driver" "fmt" @@ -41,7 +42,6 @@ import ( "github.com/apache/calcite-avatica-go/v3/message" "github.com/apache/calcite-avatica-go/v3/phoenix" "github.com/hashicorp/go-uuid" - "golang.org/x/net/context" ) // Driver is exported to allow it to be used directly. http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/go.mod ---------------------------------------------------------------------- diff --git a/go.mod b/go.mod index dae17bf..e90b0c7 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/stretchr/testify v1.2.2 // indirect github.com/xinsnake/go-http-digest-auth-client v0.4.0 golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac // indirect - golang.org/x/net v0.0.0-20180826012351-8a410e7b638d + golang.org/x/net v0.0.0-20180826012351-8a410e7b638d // indirect golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect gopkg.in/jcmturner/aescts.v1 v1.0.1 // indirect gopkg.in/jcmturner/dnsutils.v1 v1.0.1 // indirect http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/go.sum ---------------------------------------------------------------------- diff --git a/go.sum b/go.sum index 1c32e52..77aa97d 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,9 @@ github.com/xinsnake/go-http-digest-auth-client v0.4.0 h1:tTaEBUSDiMi7RDIuj0fy/ps github.com/xinsnake/go-http-digest-auth-client v0.4.0/go.mod h1:QK1t1v7ylyGb363vGWu+6Irh7gyFj+N7+UZzM0L6g8I= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac h1:7d7lG9fHOLdL6jZPtnV4LpI41SbohIJ1Atq7U991dMg= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/http_client.go ---------------------------------------------------------------------- diff --git a/http_client.go b/http_client.go index cdd05c5..823a33f 100644 --- a/http_client.go +++ b/http_client.go @@ -19,6 +19,7 @@ package avatica import ( "bytes" + "context" "database/sql/driver" "fmt" "io/ioutil" @@ -31,8 +32,6 @@ import ( avaticaMessage "github.com/apache/calcite-avatica-go/v3/message" "github.com/golang/protobuf/proto" "github.com/xinsnake/go-http-digest-auth-client" - "golang.org/x/net/context" - "golang.org/x/net/context/ctxhttp" "gopkg.in/jcmturner/gokrb5.v5/client" "gopkg.in/jcmturner/gokrb5.v5/config" "gopkg.in/jcmturner/gokrb5.v5/credentials" @@ -180,7 +179,9 @@ func (c *httpClient) post(ctx context.Context, message proto.Message) (proto.Mes c.kerberosClient.SetSPNEGOHeader(req, "") } - res, err := ctxhttp.Do(ctx, c.httpClient, req) + req = req.WithContext(ctx) + + res, err := c.httpClient.Do(req) if err != nil { return nil, err http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/rows.go ---------------------------------------------------------------------- diff --git a/rows.go b/rows.go index 9e8187d..fa3eddb 100644 --- a/rows.go +++ b/rows.go @@ -18,13 +18,13 @@ package avatica import ( + "context" "database/sql/driver" "io" "time" "github.com/apache/calcite-avatica-go/v3/internal" "github.com/apache/calcite-avatica-go/v3/message" - "golang.org/x/net/context" ) type resultSet struct { http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/statement.go ---------------------------------------------------------------------- diff --git a/statement.go b/statement.go index 6ec30c6..3e3cab2 100644 --- a/statement.go +++ b/statement.go @@ -18,13 +18,13 @@ package avatica import ( + "context" "database/sql/driver" "errors" "math" "time" "github.com/apache/calcite-avatica-go/v3/message" - "golang.org/x/net/context" ) type stmt struct { http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/c016e644/transaction.go ---------------------------------------------------------------------- diff --git a/transaction.go b/transaction.go index 53bc76e..826068f 100644 --- a/transaction.go +++ b/transaction.go @@ -18,8 +18,9 @@ package avatica import ( + "context" + "github.com/apache/calcite-avatica-go/v3/message" - "golang.org/x/net/context" ) type tx struct {
