As a modern programming language, Go comes with extensive support for HTTP clients, servers, and standard encoding handlers, including JSON and XML. Combined with the built-in string and map features, this removes many of the hurdles of working with web services. In addition to this, the format for structs in Go allows for additional tags that can provide metadata to its fields. Both the encoding/json and encoding/xml packages make use of this to understand how to correctly encode and decode instances of these structs. The following example demonstrates these features by connecting to a web service, accessing a JSON response, and decoding it into a struct that is then used like any other:
package main
import "encoding/json"
import "fmt"
import "io/ioutil"
import "net/http"
type Person struct {
Title ...