hakk

software development, devops, and other drivel
Tree lined path

HTML

HTML templating in Go

Within the Go Standard library HTML package there’s a template package which enables generating HTML page from a rich templating engine with the output safe against code injection. This means there is no need to worry about XSS attacks as Go parses the HTML template and escapes all inputs before displaying it to the browser. Let’s take a look at a simple example. This example will use a couple of structs to store data about some people and then display that data in an HTML table. Read more...