City
type City struct {
ID int
Name string
Regions []Region
}
Region
type Region struct {
ID int
Name string
Shops []Destination
Masters []Master
EducationCenters []Destination
}
In main I try to do this:
tpl.ExecuteTemplate(resWriter,"cities.gohtml",CityWithSomeData)
Is it possible to do something like this inside template?
{{range .}}
{{$city:=.Name}}
{{range .Regions}}
{{$region:=.Name}}
{{template "data" .Shops $city $region}}
{{end}}
{{end}}