Problem learning Templating

I am new to Go, but enjoying the learning. The code below produces the body of an html table
"
{{define “table”}}
[table class=“w3-table w3-striped”]
[thead]
[tr class=“w3-yellow”]
[th]Created[/th]
[th>Todo[/th]
[th>Reminder[/th]
[/tr]
[/thead]
[tbody]
{{with .}} {{range .}}
[tr onclick=“console.log(‘row clicked’)”]
[td]{{.Datecreated}}[/td]
[td]{{.Todo}}[/td]
[td]{{.Datereminder}}[/td]
[td style=“display: none”]{{.ID}}[/td]
[/tr]
{{end}} {{end}}
[/tbody]
[/table>
{{end}}
"
If I output the resulting html to os.StdOut the body of the table is present, I have taken the generated code, put it in a file and run it in Chrome and it’s fine. However, when I use chrome (localhost:3000), the only part of the page that is missing is the table body is empty. I use Content-Type text/html.

I am puzzled, any help would be appreciated.
Hilton

Sorry about presentation of html, will have to read instructions again.

So what’s the code actually rendering the template and sending the response?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.