mirror of
https://github.com/golang/oauth2.git
synced 2025-07-21 00:00:09 +08:00
internal: fix transport_test use of nil Context
The context library recommends never using a nil Context, and context.Background() provides an empty Context appropriate for use in unit tests. Change-Id: I2656f846ea1f892ad41ad63a92ecb789a46e3453 Reviewed-on: https://go-review.googlesource.com/22791 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
8434495902
commit
e86e2718db
@ -18,7 +18,7 @@ func TestContextClient(t *testing.T) {
|
||||
})
|
||||
|
||||
c := &http.Client{}
|
||||
ctx := context.WithValue(nil, HTTPClient, c)
|
||||
ctx := context.WithValue(context.Background(), HTTPClient, c)
|
||||
|
||||
hc, err := ContextClient(ctx)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user