HTML escaping converts characters with special meaning, such as &, <, and >, into representations rendered as text instead of markup or executable code. Go’s html/template applies this protection automatically when rendering HTML. section 11.1.2
Protecting a rendered value
A template value such as "</html>" should remain text rather than terminate the page; escaping also helps prevent malicious JavaScript from executing. Use html/template for HTML output instead of text/template. section 11.1.2
Listing 11.10 index.html: Outputting a variable
<!DOCTYPE html>
<html lang="en">
<head>
<title>Learn Go</title>
</head>
<body>
<h1>Habits</h1>
<p>You have {{.}} habits to follow.</p> #1
</body>
</html>
See how a dynamic value is inserted into an HTML document through the {{.}} template action. section 11.1.2


