September 2017
Intermediate to advanced
466 pages
9h 33m
English
Although getURL.go does the required job pretty quickly and without writing too much Go code, it is in a way not adaptable or informative. It just prints a bunch of raw HTML code without any other information and without the capability of dividing the HTML code into its logical parts. Therefore, getURL.go needs to be improved!
The name of the new utility will be webClient.go and will be presented to you in five segments of Go code.
The first part of the utility is the following:
package main import ( "fmt" "net/http" "net/http/httputil" "net/url" "os" "path/filepath" "strings" )
The second part of the Go code from webClient.go is the following:
func main() { if len(os.Args) != 2 { fmt.Printf("Usage: %s URL\n", ...Read now
Unlock full access