add: type assertion
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user