title: What is the difference between this usage of pointer (a:=&A; a) and (b:=B; &b)
body: <p>Can't understand following behavior. Difference of <code>d1 := &amp;data{1}; d1</code> and <code>d2 := data{1}; &amp;d1</code>. Both are pointer, right? But they behave differently. Whats happening here </p>
  
  <pre><code>package main
  
  import "fmt"
  
  type data struct {
      value int
  }
  
  func main() {
      m := make(map[string]*data)
      d1 := &amp;data{1}
      m["d1"] = d1 // Here putting &amp;{1}
      d1 = &amp;data{2}
      fmt.Println(m["d1"])
      // &amp;{1}
  
      d2 := data{1}
      m["d2"] = &amp;d2 // Here putting &amp;{1}
      d2 = data{2}
      fmt.Println(m["d2"])
      // &amp;{2}
  }
  </code></pre>
  
  <p>What is actually happening here?</p>