title: In consul-template, how to limit the number of elements over which I am ranging?
body: <p>Following is my code to render the Addresses of the nodes with a service:</p>
  
  <pre><code>    {{range "service@datacenter" "passing"}}{{.Address}} {{end}}
  </code></pre>
  
  <p>What I want to do is limit the number of addresses that are rendered. For example, if there are 5 nodes registered as providers of "service", I would like is to print addresses of 2 of them only. What I think I should be doing is slicing the array, but I am not able to get the GO syntax right. This is something that I want but is not syntactically correct:</p>
  
  <pre><code>    {{range "service@datacenter" "passing" [0:2]}}{{.Address}} {{end}}
  </code></pre>
  
  <p>What is the correct way to do this?</p>