mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-21 00:47:11 +08:00
14 lines
275 B
Go
14 lines
275 B
Go
package main
|
|
|
|
type customerStorer interface {
|
|
StoreCustomer(Customer) error
|
|
}
|
|
|
|
type CustomerService2 struct {
|
|
storer customerStorer
|
|
}
|
|
|
|
func (cs CustomerService2) CreateNewCustomer(id string) error {
|
|
customer := Customer{id: id}
|
|
return cs.storer.StoreCustomer(customer)
|
|
}
|