On Thu, Feb 27, 2025 at 9:32 AM cpu...@gmail.com <cpui...@gmail.com> wrote: > > 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?
I'm sorry, I don't understand the question. I'll try to explain what is happening. m.EqualName has to mean something. The Go language defines it as meaning the field in m's type, rather than the embedded method. Therefore, the type meter does not have a method EqualName. Therefore, the type meter does not implement the EqualName interface. I note that this kind of confusion between interface name and method name is the Go standard library is careful to do things like an interface Writer with a method Write. We don't use the same name for an interface type and the method(s) that it includes. Ian -- 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/CAOyqgcUY0uny5mb%3DOMdHUnuigZgyzWY3z%3DgdECv2-roFYbmciQ%40mail.gmail.com.