I am outputting a dropdown list using a html template, as follows:
{{range .Organisations}}
<option value="{{.Uuid}}">{{.Name}}</option>
{{end}}
I want to indicate that one of the items should be selected by doing an eq
comparator. The only potential complication I am aware of is that the .Uuid
is a *gocql.UUID
, I am trying to do this:
{{range .Organisations}}
<option value="{{.Uuid}}"{{if eq $.Contact.Organisation .Uuid}} selected="selected"{{end}}>{{.Name}}</option>
{{end}}
But it results in the following error message:
page:32:36: executing "submit_scholarship" at : error calling eq: invalid type for comparison
Any pointers in the right direction would be much appreciated.