This is 

*The method set of any other type T consists of all methods 
<https://golang.org/ref/spec#Method_declarations> declared with receiver 
type T. *

[me] (but not *T) 

 
and

*The method set of the corresponding pointer type 
<https://golang.org/ref/spec#Pointer_types> *T is the set of all methods 
declared with receiver *T or T *


plus embedding

so another way/example

package main

type S1 struct{}

func (*S1) f() {}
func (S1) g()  {}

type S2 struct{ S1 }

func main() {
// var _ = (S2).f // not ok!
var _ = (*S2).f // ok!

var _ = (*S2).g // ok!
var _ = (S2).g  // ok!
}


and S1 behaves the same (obviously)

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to