title: Why does inline instantiation of variable requires explicitly taking the address of it to call pointer method, while for a existing var its implict
body: <p>Is there a reason for this behaviour? I would like to know what is different in the memory level. The compiler returns "cannot take the address of composite literal" while i can explicitly ask it to do it.</p>
  
  <p>Heres the go playground <a href="http://play.golang.org/p/3QWpPfhUDM" rel="noreferrer">go playground link</a></p>
  
  <pre><code>u := User{"john"}
  fmt.Println(u.Name()) //implicit
  
  //fmt.Println(User{"john"}.Name()) //Error: cannot call pointer method on composite literal, cannot take the address of composite literal
  fmt.Println((&amp;User{"jim"}).Name()) //explicit
  
  type User struct {
      name string
  }
  
  func (u *User) Name() string {
      return u.name
  }
  </code></pre>