I have a struct with a bson.ObjectId type, for example something like this:
type Test struct {
Id bson.ObjectId
Name string
Foo string
}
I want to render this in an html template
{{ Name }} {{ Food }}
<a href="/remove/{{ Id }}">Remove me</a>
But this obviously doesn't work since {{ Id }}
would just return a ObjectId type, is there a way to convert this into a string inside the template?
Or do I have to do this when I pass data to the template.Execute
?