Following is my code to render the Addresses of the nodes with a service:
{{range "service@datacenter" "passing"}}{{.Address}} {{end}}
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:
{{range "service@datacenter" "passing" [0:2]}}{{.Address}} {{end}}
What is the correct way to do this?