コード例 #1
0
ファイル: factory.go プロジェクト: ddmendes/go-boutique
// NewCustomer instantiates a new Customer.
func NewCustomer() *models.Customer {
	var customer models.Customer
	customer.ID = newID()
	return &customer
}
コード例 #2
0
ファイル: storage.go プロジェクト: ddmendes/go-boutique
// GetCustomer reads a Customer identified by id from database.
func GetCustomer(id uuid.UUID) *models.Customer {
	customer := new(models.Customer)
	customer.Read(id)
	return customer
}