O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modeling product data

We have defined the Product struct in the shared/models/product.go source file to model product data:

package modelstype Product struct {  SKU string  Name string  Description string  ThumbnailPreviewURI string  ImagePreviewURI string  Price float64  Route string  SummaryDetail string  Quantity int}

The SKU field represents the product's stock keeping unit (SKU), a unique id that represents the product. In the sample data set provided, we use incrementing integer values, however, this field is of the string type to accommodate alphanumeric SKUs in the future for extensibility. The Name field represents the name of the product. The Description field represents the short description that will be included in the products listing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required