October 2015
Beginner to intermediate
400 pages
14h 44m
English
For many applications, access to information from the Internet is
as important as access to the local file system. Go provides a
collection of packages, grouped under net, that make it easy to send
and receive information through the Internet, make low-level network
connections, and set up servers, for which Go’s concurrency
features (introduced in Chapter 8) are particularly useful.
To illustrate the minimum necessary to retrieve information over HTTP,
here’s a simple program called fetch that fetches the content of
each specified URL and prints it as uninterpreted text; it’s inspired by the
invaluable utility curl. Obviously one would usually do more with such data, but this shows the basic idea. We will use this program ...