title: Setting HTTP headers
body: <p>I'm trying to set a header in my Go web server. I'm using <code>gorilla/mux</code> and <code>net/http</code> packages.</p>
  
  <p>I'd like to set <code>Access-Control-Allow-Origin: *</code> to allow cross domain AJAX.</p>
  
  <p>Here's my Go code:</p>
  
  <pre><code>func saveHandler(w http.ResponseWriter, r *http.Request) {
  // do some stuff with the request data
  }
  
  func main() {
      r := mux.NewRouter()
      r.HandleFunc("/save", saveHandler)
      http.Handle("/", r)
      http.ListenAndServe(":"+port, nil)
  }
  </code></pre>
  
  <p>The <code>net/http</code> package has documentation describing sending http request headers as if it were a client - I'm not exactly sure how to set response headers?</p>