How to compare the length of a list in html/template in golang? : <p>I am trying to compare the length of a list in golang html/template. But it is loading forever in html.</p>

<pre><code>{{ $length := len .SearchData }} {{ if eq $length "0" }}
    Sorry. No matching results found
{{ end }}
</code></pre>

<p>Could anyone help me with this?</p>
