context/ctxhttp: close httptest server

Change-Id: Ic8192f74337e021a5d72feb07b9648619d778235
Reviewed-on: https://go-review.googlesource.com/36673
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
haya14busa
2017-02-10 01:19:35 +09:00
committed by Brad Fitzpatrick
parent 236b8f043b
commit 349ad30abd

View File

@@ -19,6 +19,7 @@ func TestGo17Context(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "ok")
}))
defer ts.Close()
ctx := context.Background()
resp, err := Get(ctx, http.DefaultClient, ts.URL)
if resp == nil || err != nil {