title: Load image and css in Golang
body: <p>I setup a route in <code>server.js</code> in package <code>main</code> in root directory of project</p>
  
  <p><code>http.HandleFunc("/",route.IndexHandler)</code></p>
  
  <p>The <code>IndexHandler</code> is implemented in package <code>route</code> like this:</p>
  
  <pre><code>func IndexHandler(w http.ResponseWriter, r *http.Request) {
      data:=struct{
          Name string
      }{
          "My name",
      }
      util.RenderTemplate(w, "index", data)
  }
  </code></pre>
  
  <p>The <code>RenderTemplate</code> function is implemented in package <code>util</code> like this:</p>
  
  <pre><code>func RenderTemplate(w http.ResponseWriter, tmpl string, data interface{}) {
      cwd, _ := os.Getwd()
      t, err := template.ParseFiles(filepath.Join(cwd, "./view/" + tmpl + ".html"))
      if err != nil {
          http.Error(w, err.Error(), http.StatusInternalServerError)
          return
      }
      err = t.Execute(w, data)
      if err != nil {
          http.Error(w, err.Error(), http.StatusInternalServerError)
      }
  }
  </code></pre>
  
  <p>Directory structure in project like this:</p>
  
  <pre><code>/
  /public/css
  /public/images
  /public/js
  /route
  /view
  </code></pre>
  
  <p><code>index.html</code> view is located in folder <code>view</code>, router is in folder <code>route</code></p>
  
  <p>In <code>index.html</code> I include resources like these:</p>
  
  <p><code>&lt;link rel="stylesheet" type="text/css" href="../public/css/style.css"&gt;</code></p>
  
  <p><code>&lt;img src="../public/images/img_landing_page_mac.png"&gt;</code></p>
  
  <p>When request the appropriate path, <code>index.html</code> is still rendered, but images and stylesheet are not loaded. How can I do to include them in Golang html template engine?</p>