Minify and send HTML response in Go
The Home variable can be modified by any package. Pretty dangerous. Maybe use a private variable (or a struct that contains a private string field) and a getter method.
You're assuming that any HTML page won't be modified semantically by your transformation. This is correct for your minimalistic example, but not in the general case. For example, within &lt;pre&gt; or &lt;code&gt; tags, whitespace matters. There are probably many other ways this could go wrong. You should probably use a minifier package like this one instead.


Edit: actually, your strings.Replace(htmlJoined, "&gt; &lt;", "&gt;&lt;", -1) will probably have undesired effects even for very simple HTML pages. Consider:

this pretty &lt;em&gt;simple&lt;/em&gt; &lt;a href="http://example.com"&gt;example&lt;/a&gt;.


If you delete the space between &lt;/em&gt; and &lt;a … &gt;, it effectively deletes the visible space between "simple" and "example" when you display the page. All the more reason to use a minifier library.