MCPcopy
hub / github.com/lotusirous/go-concurrency-patterns / main

Function main

16-context/client.go:11–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9)
10
11func main() {
12
13 ctx := context.Background()
14 req, err := http.NewRequest("GET", "https://google.com", nil)
15 if err != nil {
16 log.Fatal(err)
17 }
18 req = req.WithContext(ctx)
19
20 res, err := http.DefaultClient.Do(req)
21 if err != nil {
22 log.Fatal(err)
23 }
24 defer res.Body.Close()
25 io.Copy(os.Stdout, res.Body)
26}

Callers

nothing calls this directly

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected