From 07ff3a1a95361bc75f9083d959f31194f7037c81 Mon Sep 17 00:00:00 2001 From: Ayushman-Singh <37467936+Ayushman-Singh@users.noreply.github.com> Date: Sat, 17 Mar 2018 13:47:06 +0530 Subject: [PATCH] task 5 --- submission/paah/task5 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 submission/paah/task5 diff --git a/submission/paah/task5 b/submission/paah/task5 new file mode 100644 index 0000000..44e0b3f --- /dev/null +++ b/submission/paah/task5 @@ -0,0 +1,23 @@ +package main +import ( + "fmt" + "io/ioutil" + "net/http" +) +func main() { + fmt.Printf("HTML code of %s ...\n", url) + resp, err := http.Get(url) + + if err != nil { + panic(err) + } + + defer resp.Body.Close() + + html, err := ioutil.ReadAll(resp.Body) + if err != nil { + panic(err) + } + + fmt.Printf("%s\n", html) +}