September 2017
Intermediate to advanced
466 pages
9h 33m
English
In this subsection, you will learn how to read a single web page with the help of the http.Get() function, which is going to be demonstrated in the getURL.go program. The utility will be presented in four parts; the first part of the program is the expected preamble:
package main import ( "fmt" "io" "net/http" "os" "path/filepath" )
Although there is nothing new here, you might find impressive the fact that you will use Go packages that are related to file input and output operations even though you are reading data from the internet. The explanation for this is pretty simple: Go has a uniform interface for reading and writing data regardless of the medium it is in.
The second part of getURL.go has the following Go ...
Read now
Unlock full access