When having passed functions to a template via Funcs, these can be called directly in the template. Data can also be passed via Execute.
So far, I've passed general data to the template and only called functions when for example I had to format a Time or some String. See below.
Combining both:
{{range .AssignedTickets}}
<p>FormatDate .Date</p>
<p>{{FormatEditorName .EditorID}}</p>
{{end}}
Mostly using functions, assuming only EditorID was passed as data:
{{$assignedTickets := GetAssignedTickets .EditorID}}
{{range $assignedTickets}}
<p>FormatDate .Date</p>
<p>{{FormatEditorName .EditorID}}</p>
{{end}}
When should I pass data and when should I call a function? Are there performance reasons as to avoid one of these (I'd guess I should avoid calling functions inside the template?)