add: type assertion

This commit is contained in:
Inanc Gumus
2019-08-23 17:07:45 +03:00
parent e0b2786fd9
commit 39aed37a88
23 changed files with 291 additions and 48 deletions

View File

@ -14,6 +14,8 @@ type puzzle struct {
price money
}
// if you remove this method,
// you can no longer add it to the `store` in `main()`.
func (p puzzle) print() {
fmt.Printf("%-15s: %s\n", p.title, p.price.string())
}