|| at Dec 15, 2013 at 5:02 pm
On Mon, Dec 16, 2013 at 3:12 AM, Ian Davis wrote:
Here's some sample code:http://play.golang.org/p/XhwtJAT_t0
I am trying to explain to someone why MouseDownEvent2 does not satisfy
the MouseEvent interface, but I am struggling to find the right way to
explain it. Can anyone here help?
The type keyword uses the structure of the given type to create a new
type, it doesn't care about the types methods.
So, MouseDownEvent2 has no methods because you never declared any for it.http://golang.org/ref/spec#Types
Embedding creates methods on the embedding type that delegate to
methods of the embedded field.
So, MouseDownEvent satisfies MouseEvent because it has the required methodshttp://golang.org/ref/spec#Struct_types
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 firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.