August 2019
Beginner to intermediate
798 pages
17h 2m
English
So far, we have seen how to process structured JSON data with a format that is known in advance. This kind of data can be stored in Go structures using the methods that are already described in the previous subsections.
This subsection will tell you how to read and store unstructured JSON data. The critical thing to remember is that unstructured JSON data is put into Go maps instead of Go structures – this will be illustrated in parsingJSON.go, which will be presented in four parts.
The first part of parsingJSON.go is as follows:
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
)
In this part, we just import the required Go packages.
The second part of parsingJSON.go is the following:
func main() { arguments ...Read now
Unlock full access