refactor: inteface composition
This commit is contained in:
@@ -7,18 +7,6 @@
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type puzzle struct {
|
||||
title string
|
||||
price money
|
||||
}
|
||||
|
||||
func (p puzzle) print() {
|
||||
fmt.Printf("%-15s: %s\n", p.title, p.price.string())
|
||||
}
|
||||
|
||||
// TODO: NEW
|
||||
func (p puzzle) sum() money {
|
||||
return p.price
|
||||
*product
|
||||
}
|
||||
|
Reference in New Issue
Block a user