> In most cases (or most cases in actual practice?) an interface can be 
thought of as a pointer, 

This is however, an implementation detail specific to the compiler you use 
though, correct?
And similarly, the wording of the FAQ is "fine", given that it's talking 
about the behaviour as the specification describes it (which makes no claim 
as to how an interface should be represented internally as far as I can 
tell).

Or am I completely barking up the wrong tree here?
I was under the impression that there can be (and are) many 
implementations/compilers for Go, and that everything on golang.org would 
be talking about the behaviour as the specification describes it, rather 
than as a particular compiler implements it.
On Sunday, June 6, 2021 at 6:18:38 PM UTC+1 Gregg Townsend wrote:

> On Saturday, June 5, 2021 at 2:15:27 PM UTC-7 Joshua wrote:
>
>> However, I see lots of calls of "If you're using pointers to interfaces a 
>> lot, you probably don't understand them".
>>
>> Well, what am I not understanding?
>>
>
> To answer this particular point:  In most cases (or most cases in actual 
> practice?) an interface can be thought of as a pointer, and treated as 
> such, so there's no reason to add the extra complication of another level 
> of indirection.
>
> I have to agree with the OP and Axel (and possibly others) that the 
> subsequent prose about copying a struct as a consequence of copying an 
> interface is confusing.  It surprised me to read that.  I like Brian's 
> restatement that *assignment to an interface value* causes the copy. 
>

-- 
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/9a39cb33-c002-4884-8fed-f3e4b05af0dfn%40googlegroups.com.

Reply via email to