Package htmlg contains helper funcs for generating HTML nodes and rendering them. Context-aware escaping is done just like in html/template, making it safe against code injection.
Note: This package is quite experimental in nature, so its API is susceptible to more frequent changes than the average package. This is necessary in order to keep this package useful.
go get github.com/shurcooL/htmlg