title: Assigning values to multiple variables in Go
body: <p>I recently came up across this:</p>
  
  <pre><code>func main() {
      x, y := 0, 1
      x, y = y, x+y
      fmt.Println(y)
  }
  </code></pre>
  
  <p>What I thought was that:</p>
  
  <pre><code>x, y = y, x+y
  </code></pre>
  
  <p>Is identical to:</p>
  
  <pre><code>x = y
  y = x+y
  </code></pre>
  
  <p>Which would result to final values <code>x = 1, y = 2</code></p>
  
  <p>However the final values I get is <code>x = 1, y = 1</code></p>
  
  <p>Why is that?</p>
  
  <p>Thanks.</p>