Because in a case like this:

type I int

type P *I

func (i I) Get() int { return int(i) }

func (p P) Get() int { return int(*p) }

var v I

var x = (&v).Get()

it would be unclear whether the Get method in the last line would be

I.Get or P.Get.  We could define a rule for it, but that would become

another thing that people would have to know.

https://groups.google.com/forum/#!topic/golang-nuts/qf76N-uDcHA

04-16 08:04
查看更多