MCPcopy Create free account
hub / github.com/goinaction/code / main

Function main

chapter5/listing34/listing34.go:21–34  ·  view source on GitHub ↗

main is the entry point for the application.

()

Source from the content-addressed store, hash-verified

19
20// main is the entry point for the application.
21func main() {
22 // Get a response from the web server.
23 r, err := http.Get(os.Args[1])
24 if err != nil {
25 fmt.Println(err)
26 return
27 }
28
29 // Copies from the Body to Stdout.
30 io.Copy(os.Stdout, r.Body)
31 if err := r.Body.Close(); err != nil {
32 fmt.Println(err)
33 }
34}

Callers

nothing calls this directly

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected