update: interfaces lecture

This commit is contained in:
Inanc Gumus
2019-08-23 11:03:51 +03:00
parent 435c08e800
commit e0b2786fd9
3 changed files with 88 additions and 9 deletions

View File

@ -22,6 +22,8 @@ func (l list) print() {
}
for _, it := range l {
// fmt.Printf("(%-10T) --> ", it)
it.print()
// you cannot access to the discount method of the game type.
@ -29,3 +31,18 @@ func (l list) print() {
// it.discount(.5)
}
}
// PREVIOUS CODE:
// type list []*game
// func (l list) print() {
// if len(l) == 0 {
// fmt.Println("Sorry. Our store is closed. We're waiting for the delivery 🚚.")
// return
// }
// for _, it := range l {
// it.print()
// }
// }