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.Ite
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
Le
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
Wouldn't then the argument being passed into Less(Item) and Swap(Item) be
for two different interfaces?
One.Item for Less() and Two.Item for Swap().
On Saturday, September 24, 2016 at 10:31:56 PM UTC-7, Tamás Gulácsi wrote:
>
> You can embed the interface in two.Item:
> type Item interface {
>
Wouldn't then the argument being passed into Less(Item) and Swap(Item) be
for two different Items?
One.Item for Less() and Two.Item for Swap().
On Saturday, September 24, 2016 at 10:31:56 PM UTC-7, Tamás Gulácsi wrote:
>
> You can embed the interface in two.Item:
> type Item interface {
>