100-go-mistakes/11-testing/90-testing-features/utility-function/main.go
2021-12-27 15:56:17 +01:00

22 lines
302 B
Go

package main
func NewStore() Store {
return Store{}
}
type Store struct{}
func (s Store) PutCustomer(Customer) error {
return nil
}
type Customer struct {
id string
}
func customerFactory(id string) (Customer, error) {
if id == "" {
return Customer{}, nil
}
return Customer{id: id}, nil
}