I can see that that's the difference and cause but I'm not convinced by the 
explanation (although that clearly is what happens):

If the embedded method name EqualName shadows the method name EqualName 
that should still implement the interface of the same signature? I.e. why 
doesn't the shadow implement the interface?

On Thursday, February 27, 2025 at 6:28:16 PM UTC+1 burak serdar wrote:

> The embedded name `EqualName` shahows the method called `EqualName`.
>
> Rename the `EqualName` interface to `EqualNamer`, and things work.
>
>
> On Thu, Feb 27, 2025 at 10:07 AM cpu...@gmail.com <cpu...@gmail.com> 
> wrote:
> >
> > About every single time I feel like I understand Go interfaces I'm being 
> taught differently.
> >
> > Consider this play: https://play.golang.com/p/qeF4KvaPcwp
> >
> > There are 2 single method interfaces. One where interface and method 
> names are equal, one where they are different.
> >
> > I would have expected m to implement both interfaces, but it doesn't. 
> Why is that?
> >
> > Thanks,
> > Andi
> >
> > --
> > 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...@googlegroups.com.
> > To view this discussion visit 
> https://groups.google.com/d/msgid/golang-nuts/22aaa13f-41d9-4d4c-93c8-455faaef50c2n%40googlegroups.com
> .
>

-- 
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.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/bd048d4e-b0ab-41cb-ae4b-4bb75fa73973n%40googlegroups.com.

Reply via email to