diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-03-23 16:22:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 16:22:56 +0800 |
commit | 3fa0fa713bc1508835bdecd7dea78ff09803e327 (patch) | |
tree | 6a5d4a7dcfd72489bd4f7df70f5188a636947c24 /rpc/http.go | |
parent | 525116dbff916825463931361f75e75e955c12e2 (diff) | |
parent | f1534f5797664856218c8347366488f37f1e7924 (diff) | |
download | go-tangerine-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar go-tangerine-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.gz go-tangerine-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.bz2 go-tangerine-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.lz go-tangerine-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.xz go-tangerine-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.zst go-tangerine-3fa0fa713bc1508835bdecd7dea78ff09803e327.zip |
Merge pull request #3809 from fjl/all-use-normal-context
all: import "context" instead of "golang.org/x/net/context"
Diffstat (limited to 'rpc/http.go')
-rw-r--r-- | rpc/http.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rpc/http.go b/rpc/http.go index 5a0770231..89175b149 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -18,6 +18,7 @@ package rpc import ( "bytes" + "context" "encoding/json" "fmt" "io" @@ -29,7 +30,6 @@ import ( "time" "github.com/rs/cors" - "golang.org/x/net/context" ) const ( @@ -115,11 +115,11 @@ func (hc *httpConn) doRequest(ctx context.Context, msg interface{}) (io.ReadClos if err != nil { return nil, err } - client, req := requestWithContext(hc.client, hc.req, ctx) + req := hc.req.WithContext(ctx) req.Body = ioutil.NopCloser(bytes.NewReader(body)) req.ContentLength = int64(len(body)) - resp, err := client.Do(req) + resp, err := hc.client.Do(req) if err != nil { return nil, err } |