title: How can I make template.Execute() to write to a file rather than to response.Writer?
body: <p>I have a below code to parse the template file and write the parsed html to ResponseWriter:-  </p>
  
  <pre><code>package main
  
  import (
      "net/http"
      "html/template"
  )
  
  func handler(w http.ResponseWriter, r *http.Request) {
      t, _ := template.ParseFiles("view.html")
      t.Execute(w, "Hello World!")
  }
  
  func main() {
      server := http.Server{
          Addr: "127.0.0.1:8080",
      }
      http.HandleFunc("/view", handler)
      server.ListenAndServe()
  }  
  </code></pre>
  
  <p>and the template file "template.html" is as:  </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;First Program&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      {{ . }}
  &lt;/body&gt;
  &lt;/html&gt;  
  </code></pre>
  
  <p>Now, Instead of writing parsed/executed file to ResponseWriter, I would like to write those contents to html file say "parsed.html". How can I achieve it. I'm new to Go, so having hard time getting the idea. Thank you.</p>