I have a []struct{}
and that []struct{}
has a field called ThreadName
and I'm trying to access that from in the template like so:
{{ index .Posts 0 $.ThreadName}}
not sure how to do this properly any information would be great thanks.
I have a []struct{}
and that []struct{}
has a field called ThreadName
and I'm trying to access that from in the template like so:
{{ index .Posts 0 $.ThreadName}}
not sure how to do this properly any information would be great thanks.
Use the following to access the thread name of the first post:
{{(index .Posts 0).ThreadName}}