main is the entry point for the application.
()
| 19 | |
| 20 | // main is the entry point for the application. |
| 21 | func 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 | } |