I have a structure with type bson.ObjectId, for example, something like this:
type Test struct { Id bson.ObjectId Name string Foo string }
I want to do this in an html template
{{ Name }} {{ Food }} <a href="/remove/{{ Id }}">Remove me</a>
But this obviously does not work, since {{ Id }} will simply return the ObjectId type, is there any way to convert it to a string inside the template?
Or do I need to do this when I pass data to template.Execute ?
html go templates
woutr_be
source share