title: Remove spaces around passed argument via html/template
body: <p>When i pass argument to onclick function i got spaces around that argument, why and  how remove them?</p>
  
  <pre><code>t, _ := template.New("").Parse(`&lt;div onclick="test({{.}})"&gt;{{.}}&lt;/div&gt;`)
  t.Execute(os.Stdout, 1)
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>&lt;div onclick="test( 1 )"&gt;1&lt;/div&gt;
  </code></pre>
  
  <p><a href="https://play.golang.org/p/e6-Se0-RQYr" rel="nofollow noreferrer">playground</a></p>
  
  <p>Edit:</p>
  
  <p>Updated by Dave help, from template we can do something like this:</p>
  
  <pre><code>t, _ := template.New("").Funcs(template.FuncMap{
      "test": func(i interface{}) template.JS {
          switch i.(type) {
          case int:
              s := strconv.Itoa(i.(int))
              return template.JS(s)   
          // other types
          default:
              panic("bad type")
          }
      },
  }).Parse(`&lt;div onclick="test({{test .}})"&gt;{{.}}&lt;/div&gt;`)
  t.Execute(os.Stdout, 1)
  </code></pre>
  
  <p><a href="https://play.golang.org/p/XdQnAXM60-5" rel="nofollow noreferrer">playground</a></p>