有关详情,请参阅 Go 常见问题解答中的 Should I define methods on values or pointers?。
示例:
type S struct{ } func (s *S) fun() {} func (s S) fun2() {}