title: Golang, template is undefined
body: <p>I'm currently trying to create a small web application using golang and I'm following the tutorial on their webpage (<a href="https://golang.org/doc/articles/wiki/final.go" rel="nofollow noreferrer">https://golang.org/doc/articles/wiki/final.go</a>). Instead of having the templates on the same folder as the rest of the code I'm trying to move them into <code>templates/template_name.html</code>.</p>
  
  <p>For template rendering I'm using the following code:</p>
  
  <pre><code>var templates = template.Must(template.ParseFiles("templates/edit.html", "templates/view.html"))
  
  func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) {
      err := templates.ExecuteTemplate(w, "templates/"+tmpl+".html", p)
      if err != nil {
              http.Error(w, err.Error(), http.StatusInternalServerError)
      }
  }
  </code></pre>
  
  <p>And for example my View handler is the following:</p>
  
  <pre><code>func viewHandler(w http.ResponseWriter, r *http.Request, title string) {                                                                                                                                    
      p, err := loadPage(title)                                                                                                                                                                           
      if err != nil {                                                                                                                                                                                     
              http.Redirect(w, r, "/edit/"+title, http.StatusFound)                                                                                                                                       
              return                                                                                                                                                                                      
      }                                                                                                                                                                                                   
      renderTemplate(w, "view", p)                                                                                                                                                                        
  
  }
  </code></pre>
  
  <p>I have the <code>templates/</code> folder with the <code>edit.html</code> and <code>view.html</code> file inside. I run the full code with: <code>go run wiki.go</code> but when I try to access the webpage I get the following error:</p>
  
  <pre><code>html/template: "templates/view.html" is undefined
  </code></pre>
  
  <p>Any idea of what might be happening?</p>