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
有疑问加站长微信联系(非本文作者)