But unfortunately that would mean changing the public interface of Two.Item. Which is not desired (but that wasn't specified explicitly in the example given).
On Sunday, September 25, 2016 at 3:22:57 AM UTC-7, question....@gmail.com wrote: > > The interface for One.Item is expecting a One.Item as an argument to its > Less() method. > By embedding it in Two.Item, that shouldn't change that correct? > > So the resulting public interface for Two.Item *after embedding* One.Item > is technically. > > type Item interface { > Less(One.Item) bool > Len() int > Swap(Two.Item) > } > > But I see what you mean given the example, that would be appropriate for > SomeOperation(One.Item). > > > > > On Sunday, September 25, 2016 at 12:10:37 AM UTC-7, Tamás Gulácsi wrote: >> >> An interface is not a class, but the contract of minimal provided >> methods: as Two has more methods, anything implements a two.Item will also >> implement one.Item. > > -- 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.