mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-20 16:45:56 +08:00
22 lines
302 B
Go
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
|
|
}
|