100-go-mistakes/2-code-project-organization/5-interface-pollution/decoupling/without.go
2021-12-27 15:56:17 +01:00

20 lines
325 B
Go

package main
type CustomerService struct {
store Store
}
func (cs CustomerService) CreateNewCustomer(id string) error {
customer := Customer{id: id}
return cs.store.StoreCustomer(customer)
}
type Customer struct {
id string
}
type Store struct{}
func (s Store) StoreCustomer(customer Customer) error {
return nil
}