refactor: inteface composition

This commit is contained in:
Inanc Gumus
2019-08-27 15:21:17 +03:00
parent 5d7047a66f
commit aff765c4a8
12 changed files with 151 additions and 146 deletions

View File

@@ -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
}