The template data object that will be passed to the template renderer will be a templatedata.ShoppingCart struct (defined in the shared/templatedata/shoppingcart.go source file):
type ShoppingCart struct {
PageTitle string
Products []*models.Product
}
The PageTitle field will be used to display the web page title and the Products field, a slice of Product objects, will be used to display the products that are currently in the shopping cart.
Now that we have the templates in place, let's take a look at modeling the shopping cart.