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:
Jeff Craig 2016-05-04 16:09:14 -05:00 committed by Brad Fitzpatrick
parent 8434495902
commit e86e2718db

View File

@ -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 {