Update 02.6.md

Fixed typo. Changed "have" to "behave".
This commit is contained in:
pockhiss
2015-07-12 07:54:58 -05:00
committed by James Miranda
parent aa0e47a632
commit 9e9f45b329

View File

@@ -326,7 +326,7 @@ One thing you should remember is that `element.(type)` cannot be used outside of
### Embedded interfaces
The most beautiful thing is that Go has a lot of built-in logic syntax, such as anonymous fields in struct. Not suprisingly, we can use interfaces as anonymous fields as well, but we call them `Embedded interfaces`. Here, we follow the same rules as anonymous fields. More specifically, if an interface has another interface embedded within it, it will have as if it has all the methods that the embedded interface has.
The most beautiful thing is that Go has a lot of built-in logic syntax, such as anonymous fields in struct. Not suprisingly, we can use interfaces as anonymous fields as well, but we call them `Embedded interfaces`. Here, we follow the same rules as anonymous fields. More specifically, if an interface has another interface embedded within it, it will behave as if it has all the methods that the embedded interface has.
We can see that the source file in `container/heap` has the following definition: