title: how to check empty value of a string in golang template
body: <p>I have this below golang template code snippet where I take values from a map of type <code>map[string]interface{}</code> and check if that string is empty or not but my string empty check is failing as:
  <code>template: apps.html:62:29: executing "apps.html" at &lt;eq $src ""&gt;: error calling eq: invalid type for comparison</code> . I tried to print the empty value also and it is rendered as <code>&lt;nil&gt;</code> but my <code>{{if eq $src "&lt;nil&gt;"}}</code> check is also failing and even if I put <code>nil</code> then also it fails. Is there any better way to achieve this.</p>
  
  <pre><code>    {{$src := (index . "source")}}
      {{$tar := (index . "target")}}
      {{if eq $src ""}}
            &lt;div&gt;&lt;/div&gt;
      {{else}}
            &lt;div style="display:none;"&gt;
                &lt;input id="username" name="source" value="{{ $src }}"/&gt;
                &lt;input id="username" name="target" value="{{ $tar }}"/&gt;
            &lt;/div&gt;
      {{end}}
  </code></pre>