Fix typos in c2.4 of the English version

This commit is contained in:
digitalcraftsman
2015-08-27 16:17:44 +02:00
parent baf203c62d
commit 38386091ec

View File

@@ -133,9 +133,9 @@ Let's see one example.
![](images/2.4.student_struct.png?raw=true)
Figure 2.7 Inheritance in Student and Human
Figure 2.7 Embedding in Student and Human
We see that we can access the age and name fields in Student just like we can in Human. This is how embedded fields work. It's very cool, isn't it? Hold on, there's something cooler! You can even use Student to access Human in this embedded field!
We see that we can access the `age` and `name` fields in Student just like we can in Human. This is how embedded fields work. It's very cool, isn't it? Hold on, there's something cooler! You can even use Student to access Human in this embedded field!
mark.Human = Human{"Marcus", 55, 220}
mark.Human.age -= 1
@@ -176,7 +176,7 @@ All the types in Go can be used as embedded fields.
fmt.Println("Her skills now are ", jane.Skills)
// modify embedded field
jane.int = 3
fmt.Println("Her preferred number is", jane.int)
fmt.Println("Her preferred number is ", jane.int)
}
In the above example, we can see that all types can be embedded fields and we can use functions to operate on them.