title: Go: Can you use range with a slice but get references? (iteration)
body: <p>Say I want to change a value for all objects in an array.
  I like the range syntax a lot more than just named for loops.</p>
  
  <p>So I tried:</p>
  
  <pre><code>type Account struct {
     balance int
  }
  type AccountList []Account
  var accounts AccountList
  ...
  ....
  // to init balances
  for _,a := range( accounts ) {
      a.balance = 100
  }
  </code></pre>
  
  <p>That did not work since a is a copy of the entries from the AccountList and we are thus updating the copy only.</p>
  
  <p>This does work as I need it to:</p>
  
  <pre><code>for a := range( accounts ) {
    accounts[a].balance = 100
  }
  </code></pre>
  
  <p>But that code has an extra lookup inside the for loop.</p>
  
  <p>Is there a way to do an iterator that gets references to the structs in the AccountList?</p>