

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: JSON Syntax
incomplete
2: Decoding JSON
incomplete
3: JSON Review
incomplete
4: Unmarshal JSON
incomplete
5: Marshal JSON
incomplete
6: XML
incomplete
7: Why Use XML?
incomplete
8: map[string]interface{}
incomplete
This lesson's interactive features are locked, please to keep using them
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.
First issue object:
id: 0 (number)
name: "Fix the thing" (string)
estimate: 0.5 (number)
completed: false (boolean)
Second issue object:
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 check that your constants contain valid JSON with the expected shape and values.
You can use a backtick (`) to create a multi-line string in Go. This will make it easier to write the JSON data.