title: Setting the 'charset' property on the Content-Type header in the golang HTTP FileServer
body: <p>I've got an issue when testing a golang web app. In the deployed version, nginx fronts the application and explicitly sets <code>charset utf8;</code> so that all textual content types are appended with a charset declaration.</p>
  
  <p>In testing, I'm hitting the golang application directly, and here the content type does not have a charset set. This is causing problems when trying to serve libraries like <a href="https://github.com/mbostock/d3/blob/v3.5.6/d3.js#L1261" rel="nofollow">d3</a> which has lines like:</p>
  
  <pre><code>var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;
  </code></pre>
  
  <p>Because golang doesn't specify the charset, these are rendered in chrome as:</p>
  
  <pre><code>var Îµ = 1e-6, Îµ2 = Îµ * Îµ....
  </code></pre>
  
  <p>What's the best way of getting the golang http server to output the charset=utf8 declaration on the HTTP headers?</p>