mirror of
https://github.com/golang/net.git
synced 2026-03-31 10:27:08 +09:00
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:
committed by
Brad Fitzpatrick
parent
236b8f043b
commit
349ad30abd
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user