diff options
author | Jeff Craig <jeffcraig@google.com> | 2016-05-04 16:09:14 -0500 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-05-04 21:42:46 +0000 |
commit | e86e2718db89775a4604abc10a5d3a5672e7336e (patch) | |
tree | bbc1937855cfd9e38ce3dfdbc4430ace2399dd17 /internal | |
parent | 8434495902bd0900797016affe4ca35c55babb3f (diff) | |
download | golang-x-oauth2-e86e2718db89775a4604abc10a5d3a5672e7336e.tar.gz |
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>
Diffstat (limited to 'internal')
-rw-r--r-- | internal/transport_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/transport_test.go b/internal/transport_test.go index 313f637..8772ec5 100644 --- a/internal/transport_test.go +++ b/internal/transport_test.go @@ -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 { |