I thought of implementing security concerns based on OWASP XSS threats. Or did you mean other security concerns?
RULE #0 - Never Insert Untrusted Data Except in Allowed Locations
<script>{{.BaseScript}}</script>
<!-- {{.BaseHtmlComment}} -->
<div {{.BaseHtmlAttribute}}=test></div>
<{{.BaseHtmlStartElement}} href="/test" />
<style>{{.BaseStyle}}</style>
RULE #1 - HTML Escape Before Inserting Untrusted Data into HTML Element Content
<body>{{.HtmlElement}}</body>
<div>{{.HtmlElement}}</div>
RULE #2 - Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes
<div attr={{.AttributeNothing}}>content</div>
<div attr='{{.AttributeSingle}}'>content</div>
<div attr="{{.AttributeDouble}}">content</div>
RULE #3 - JavaScript Escape Before Inserting Untrusted Data into JavaScript Data Values
<script>alert('{{.JsFnQuotedSingle}}')</script>
<script>x='{{.JsVar}}'</script>
<a onx='f("{{.JsFnQuotedDouble}}")' />
<a onx='f({{.JsFn}})' />
<a onx='pattern = /{{.JsPattern}}/;' />
RULE #3.1 - HTML escape JSON values in an HTML context and read the data with JSON.parse
<script>var pair = {{.JsonValue}};</script>
<script id="init_data" type="application/json">{{.JsonValue}}</script>
RULE #4 - CSS Escape And Strictly Validate Before Inserting Untrusted Data into HTML Style Property Values
<a style="border-{{.CssAttribute}}: 4px" />
<a style="align: {{.CssValue}}" />
<a style="background: '{{.CssValueSingle}}' />
<a style="background: url({{.CssValueUrl}}) />
<style>
div { background: "{{.CssValueDouble}}";}
div { background-url : {{.CssValueUrlJs}}; }
div { text-size: "expression({{.CssValueExpression}})"; }
</style>
RULE #5 - URL Escape Before Inserting Untrusted Data into HTML URL Parameter Values
<a href='{{.Url}}' />
<a href='/{{.UrlPath}}' />
<a href='?dir={{.UrlParam}}' />
RULE #6 - Sanitize HTML Markup with a Library Designed for the Job
RULE #7 - DOM XSS
<script>document.write({{.DomXss}} + document.location.hash);</script>