On Tuesday, 23 February 2021 at 07:01:27 UTC+1 Henry wrote:
> I think the problem is that people try to use embedding in place of
> inheritance. [...] Embedding shares many similarities to inheritance
The first part is a real common problem but I have to admit I do not
understand
where the se
I think the problem is that people try to use embedding in place of
inheritance. You can see that in the original author's example involving
Cat, Animal, and Pack. Embedding shares many similarities to inheritance,
such as method promotion, but they are not the same. Embedding is in a way
more
On Mon, Feb 22, 2021 at 12:52 PM mi...@ubo.ro wrote:
>
> Is there any proposal in Go 2.0 to remove the promotion of methods on
> embedded struct fields or do you think it's a good idea ? For example in the
> code below if someone marshals `Pack`, only `Animal` is actually marshalled.
> Cat fiel
Is there any proposal in Go 2.0 to remove the promotion of methods on
embedded struct fields or do you think it's a good idea ? For example in
the code below if someone marshals `Pack`, only `Animal` is actually
marshalled. Cat field is skipped. If he wants to marshal Cat as well the
developer