Browse Source

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>
haya14busa 8 years ago
parent
commit
349ad30abd
1 changed files with 1 additions and 0 deletions
  1. 1 0
      context/ctxhttp/ctxhttp_17_test.go

+ 1 - 0
context/ctxhttp/ctxhttp_17_test.go

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