title: How do I parse variables outside the range in Go templates?
body: <p>I have two structs as below and I need to render the data on a template using the <a href="http://golang.org/pkg/text/template/" rel="noreferrer">templates</a> pack. I get this error  </p>
  
  <p><code>&lt;.Email&gt;: Email is not a field of struct type Notes</code>.</p>
  
  <p>The issue seems to be that only fields of the range struct seem to be available within the range loop so I'm wondering how I can import fields from outside the range struct (e.g. the Email string).</p>
  
  <p>The behavior is quite unexpected.</p>
  
  <pre><code>type notes struct{
      Note string
      sf string
  }
  
  type uis struct{
      notes []Note
      Email string
  }
  
  var ui uis
  </code></pre>
  
  <p><em>HTML</em> </p>
  
  <pre><code>{{range .notes}}
      {{.Email}} {{.sf}}
      {{end}}
  
  Email {{.Email}}
  </code></pre>
  
  <p>I've checked the godocs but they seem quite useless. </p>