diff --git a/03-projects/01-first-project/README.md b/03-projects/01-first-project/README.md index df9cdaf..8d3179f 100644 --- a/03-projects/01-first-project/README.md +++ b/03-projects/01-first-project/README.md @@ -27,7 +27,7 @@ You want to split up your app in many different files. Let's say you have the fo helper.go ``` -What you are saying above is that your program consists of many files and that you want code in the fiile *main.go* to use code from *helper.go* for example. +What you are saying above is that your program consists of many files and that you want code in the file *main.go* to use code from *helper.go* for example. To handle such a case, you need the following: diff --git a/04-webdev/01-json/README.md b/04-webdev/01-json/README.md index 8715709..33f46bf 100644 --- a/04-webdev/01-json/README.md +++ b/04-webdev/01-json/README.md @@ -81,19 +81,19 @@ So that means, we need to add the following annotations to our above created str ```go type Product struct { - Id int `json: "id"` - Name string `json: "name"` + Id int `json:"id"` + Name string `json:"name"` } type Response struct { - Products []Product `json: "products"` + Products []Product `json:"products"` } ``` What these annotations do is to say, in the JSON data, look for properties with these names and map them to the following property. Like in this example from above: ```go -Id int `json: "id"` +Id int `json:"id"` ``` ### Reading the data @@ -151,12 +151,12 @@ import ( ) type Products struct { - Products []Product `json: products` + Products []Product `json:"products"` } type Product struct { - Id int `json: "id"` - Name string `json: "name"` + Id int `json:"id"` + Name string `json:"name"` } func main(){ @@ -193,8 +193,8 @@ import ( ) type Person struct { - Id int `json: "id"` - Name string`json: "name"` + Id int `json:"id"` + Name string`json:"name"` } func main() { @@ -248,18 +248,18 @@ import ( ) type OrderItem struct { - Id int `json: "id"` - Quantity int `json: "quantity"` - Total float32 `json: "total"` + Id int `json:"id"` + Quantity int `json:"quantity"` + Total float32 `json:"total"` } type Order struct { - Id int `json: "id"` - Items []OrderItem `json: items` + Id int `json:"id"` + Items []OrderItem `json:"items"` } type Response struct { - Orders []Order `json: orders` + Orders []Order `json:"orders"` } func main() {