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

Feeding data to the content template

The data object that we will feed to the about content template is a slice of pointers to Gopher structs that represent each gopher on the IGWEB team. The plan for feeding data to our template is to obtain a slice of gophers from the Redis datastore and populate the Gophers property of the template data object for the About page along with the data object's PageTitle property.

We call the GetGopherTeam method on our datastore object to obtain a slice of gophers that belongs to the IGWEB team. Here's the declaration of the GetGopherTeam function from the redis.go source file found in the common/datastore folder:

func (r *RedisDatastore) GetGopherTeam() []*models.Gopher { exists, err := r.Cmd("EXISTS", "gopher-team").Int() ...

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