1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
18 func TestGo17Context(t *testing.T) {
19 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
20 io.WriteString(w, "ok")
23 ctx := context.Background()
24 resp, err := Get(ctx, http.DefaultClient, ts.URL)
25 if resp == nil || err != nil {
26 t.Fatalf("error received from client: %v %v", err, resp)