It's because your method and field have the same name, if you rename the
interface to SameNamer (and thus rename the field as well) it will work.

On Thu, Feb 27, 2025 at 12:07 PM cpu...@gmail.com <cpui...@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+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/golang-nuts/22aaa13f-41d9-4d4c-93c8-455faaef50c2n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/22aaa13f-41d9-4d4c-93c8-455faaef50c2n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAA%3DsxTgwWuA3NBpO0CghDUGSBnFBF7%3D_4ZDJBhVDpMwAN9KqRQ%40mail.gmail.com.

Reply via email to