title: Using conditions inside templates
body: <p>The use of if statements inside templates really is puzzling me.</p>
  
  <p>I'm trying to put a <code>class = "active"</code> inside a nav list made with golang templates, to do a basic tab menu that detects the active tab.
  Here's my attempt :</p>
  
  <pre><code>{{define "header"}}
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Geoprod&lt;/title&gt;
          {{template "stylesheet" .}}
      &lt;/head&gt;
      &lt;body&gt;
          &lt;nav class="navbar" role="navigation"&gt;
            &lt;div class="navbar-header"&gt;
              &lt;a{{if eq .Active "accueil"}} class="active"{{end}} href="/"&gt;Geoprod&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class="navbar-body"&gt;
              &lt;ul class="navbar-list"&gt;
                  &lt;li{{if eq .Active "societe"}} class="active"{{end}}&gt;&lt;a href="/societe"&gt;Soci&amp;eacutet&amp;eacute&lt;/a&gt;&lt;/li&gt;
                  &lt;li{{if eq .Active "dossier"}} class="active"{{end}}&gt;&lt;a href="/dossier"&gt;Dossier&lt;/a&gt;&lt;/li&gt;
                  &lt;li{{if eq .Active "temps"}} class="active"{{end}}&gt;&lt;a href="/temps"&gt;Temps&lt;/a&gt;&lt;/li&gt;
                  &lt;li{{if eq .Active "mails"}} class="active"{{end}}&gt;&lt;a href="/mails"&gt;Mails&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/div&gt;
          &lt;/nav&gt;
  {{end}}
  </code></pre>
  
  <p>And in main.go :</p>
  
  <pre><code>var FuncMap = template.FuncMap{
      "eq": func(a, b interface{}) bool {
          return a == b
      },
  }
  var templates = template.Must(template.ParseGlob("templates/*.html"))
  </code></pre>
  
  <p>and in func main()</p>
  
  <pre><code>templates.Funcs(FuncMap)
  </code></pre>
  
  <p>The program compiles, but i've found out adding the <code>{{if eq .Active "something"}} class="active"{{end}}</code> (^^ which I included here) causes the program to not display any text anymore. Any idea why?</p>