title: Custom function is not working in template
body: <p>I've the below that is working fine <a href="https://play.golang.org/p/GXlDttQWcv8" rel="nofollow noreferrer">playground</a></p>
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import (
      &quot;html/template&quot;
      &quot;os&quot;
  )
  
  func main() {
      tmpl := `
  {{ $slice := mkSlice &quot;a&quot; 5 &quot;b&quot; }}
  {{ range $slice }}
       {{ . }}
  {{ end }}
  `
      funcMap := map[string]interface{}{&quot;mkSlice&quot;: mkSlice}
      t := template.New(&quot;&quot;).Funcs(template.FuncMap(funcMap))
      template.Must(t.Parse(tmpl))
      t.Execute(os.Stdout, nil)
  }
  
  func mkSlice(args ...interface{}) []interface{} {
      return args
  }
  </code></pre>
  <p>But once I tried to run in from template file, nothing had been displayed, and no error had been recieved!</p>
  <pre class="lang-golang prettyprint-override"><code>func mkSlice(args ...interface{}) []interface{} { // to ceate the array in the template
      return args
  }
  
  funcMap := map[string]interface{}{&quot;mkSlice&quot;: mkSlice}
  tmpl := template.New(&quot;&quot;).Funcs(template.FuncMap(funcMap))
  template.Must(tmpl.ParseFiles(&quot;index.html&quot;))
  tmpl.Execute(w, nil)
  </code></pre>
  <p>And <code>index.html</code> is:</p>
  <pre class="lang-html prettyprint-override"><code>{{ $slice := mkSlice &quot;a&quot; 5 &quot;b&quot; }}
  {{ range $slice }}
      &lt;span&gt; {{ . }} &lt;/span&gt;
  {{ end }}
  </code></pre>
  <p>any thought?</p>