JSON (JavaScript Object Notation), is a standard for representing structured data based on JavaScript's object syntax. It is commonly used to transmit data in web apps via HTTP. For example, The HTTP requests we have been making in this course have been returning Jello issues as JSON.
JSON supports the following primitive data types:
"Hello, World!"42 or 3.14truenullAnd the following collection types:
[1, 2, 3]{"key": "value"}JSON is similar to JavaScript objects and Python dictionaries. Keys are always strings, and the values can be any data type, including other objects.
The following is valid JSON data:
{
"movies": [
{
"id": 1,
"title": "Iron Man",
"director": "Jon Favreau",
"favorite": true
},
{
"id": 2,
"title": "The Avengers",
"director": "Joss Whedon",
"favorite": false
}
]
}
Complete the issueList and userObject string constant values.
ISSUE ONE:
id: 0 (number)
name: "Fix the thing" (string)
estimate: 0.5 (number)
completed: false (boolean)
ISSUE TWO:
id: 1 (number)
name: "Unstick the widget" (string)
estimate: 30 (number)
completed: false (boolean)
name: "Wayne Lagner" (string)
role: "Developer" (string)
remote: true (boolean)
The tests simply check that the JSON is valid.
You can use a backtick (`) to create a multi-line string in Go. This will make it easier to write the JSON data.