type A struct{}
func (*A) F() {}
func main() {
a := A{}
a.F() // OK
(&a).F() // OK
(&A{}).F() // OK
A{}.F() // Error: cannot call pointer method F on A
(A{}).F() // Error: cannot call pointer method F on A
}
Why can't I call a pointer method on a temporary object in golang?