reorganize: interfaces section

This commit is contained in:
Inanc Gumus
2019-08-21 20:38:38 +03:00
parent 8cb42216e4
commit c282da3c6d
27 changed files with 126 additions and 20 deletions

View File

@ -7,8 +7,6 @@
package main
import "fmt"
func main() {
mobydick := book{
title: "moby dick",
@ -25,12 +23,6 @@ func main() {
price: 5,
}
// #4: method expressions
// methods are just functions that receive a value of a type.
game.print(minecraft) // sends `minecraft` value to `game.print`
game.print(tetris) // sends `tetris` value to `game.print`
fmt.Println()
// #3
mobydick.print() // sends `mobydick` value to `book.print`
minecraft.print() // sends `minecraft` value to `game.print`