Update golang dependencies
This commit is contained in:
parent
c5e30973e5
commit
9ddf98769a
1009 changed files with 175867 additions and 50378 deletions
12
vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go
generated
vendored
12
vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go
generated
vendored
|
|
@ -27,7 +27,17 @@ func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Resp
|
|||
if client == nil {
|
||||
client = http.DefaultClient
|
||||
}
|
||||
return client.Do(req.WithContext(ctx))
|
||||
resp, err := client.Do(req.WithContext(ctx))
|
||||
// If we got an error, and the context has been canceled,
|
||||
// the context's error is probably more useful.
|
||||
if err != nil {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
err = ctx.Err()
|
||||
default:
|
||||
}
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
||||
// Get issues a GET request via the Do function.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue