Thank you, it is clear now.

On Tue, Jan 7, 2020 at 11:10 AM Ian Lance Taylor <i...@golang.org> wrote:

> On Mon, Jan 6, 2020 at 9:18 PM Prabhu Chawandi <prabhuchawa...@gmail.com>
> wrote:
> >
> >   I was reading this article @
> https://blog.golang.org/laws-of-reflection
> >
> > Excerpt:
> >
> > One important detail is that the pair inside an interface always has the
> form (value, concrete type) and cannot have the form (value, interface
> type). Interfaces do not hold interface values.
> >
> > I could not understand it clearly, Can through some clarity with an
> example?
> >
> > I tried this and did not give any error.
> >
> > @ https://play.golang.org/p/Q5jRWp6MF7c
>
> Interfaces do not hold interface values.
>
> What this means is that when you write "a = b" where a and b are both
> of interface type, then the value that is in b will be copied to a.  a
> will wind up with the dynamic type and dynamic value that were
> originally in b.  The dynamic type of a will not become the type of b;
> it will become the dynamic type of the value stored in b.
>
> Ian
>


-- 
Cheers
p.

-- 
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 on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAN9r%3DsyFvWiYGf0m%2BaT6By4VhO_cGH0-V0vs%3DaffCFHfLm1ZtA%40mail.gmail.com.

Reply via email to