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,10 +14,6 @@ type puzzle struct {
price money
}
func (p *puzzle) print() {
func (p puzzle) print() {
fmt.Printf("%-15s: %s\n", p.title, p.price.string())
}
func (p *puzzle) discount(ratio float64) {
p.price *= money(1 - ratio)
}