I have structure like these
type Users struct{
Name string `json:"Name,omitempty"`
Gender string `json:"Gender,omitempty"`
Communication []*Communication `json:"Communication,omitempty"`
}
type Communication struct {
Type string `json:"Type,omitempty"`
Value string `json:"Value,omitempty"`
}
every user will have two communication structure like
[
{
"Type": "MOBILE",
"Value": "12121212"
},
{
"Type": "Email",
"Value": "Some@email.com"
}
]
In my template i want to display them in a table. iam getting the User structure values, but could not get the communication structure values
HTML Template file (partial code):
<tbody>
{{range $key, $val := .Users}}
<td style="text-align: center;">{{$val.Name}}</td>
<td style="text-align: center;">{{$val.Gender}}</td>
///////How to display communication values here??////////////
{{end}}
</tbody>