$ go run test3.go # command-line-arguments ./test3.go:25:11: cannot use xiaoming (type user) as type notifier in argument to baozhuang: user does not implement notifier (notify method has pointer receiver)
这个涉及到一个叫方法集的玩意。讲一讲它的规则:
1 2 3 4 5 6
-------------------------- 值 接收者 -------------------------- T (t T) *T (t T) and (t *T) --------------------------
比较好理解的是下面这个
1 2 3 4 5 6
-------------------------- 接收者 值 -------------------------- (t T) T and *T (t *T) *T --------------------------