title: GO html/template: test equality of two dot variables
body: <p>I'm sending an html/template this model:</p>
  
  <pre><code>type MapModel struct {
  Networks      []*NetworkMeta
  WaveKey       string
  </code></pre>
  
  <p>}</p>
  
  <p>The Networks field is defined by another type, NetworkMeta:</p>
  
  <pre><code>type NetworkMeta struct {
  NetworkMetaKey string
  </code></pre>
  
  <p>}</p>
  
  <p>I use the Networks array to produce an html select object:</p>
  
  <pre><code>            &lt;select name="waveKey" id="waveKey"&gt;
      {{range .Networks}}
              &lt;option value="{{ .NetworkMetaKey}}" {{if eq .NetworkMetaKey .WaveKey }} selected="selected" {{end}}&gt;
              {{ .NetworkMetaKey }}
              &lt;/option&gt;
      {{end}}
  </code></pre>
  
  <p>Everything here works except the "if eq" equality test. That test returns the error: "WaveKey is not a field of struct type *models.NetworkMeta."</p>
  
  <p>As I understand the html/template eq operator, the comparison tests one value against another (or a group of values), the one separated from the rest by a space. In this case, however, the error seems to indicate that for a field, the compiler ignores the space. </p>
  
  <p>Is there any way to make this equality work? Do I need to write a custom func?</p>
  
  <p>Thanks for any help.</p>