FAQ
If the struct (or whatever) will fit in the pointer-sized space in the
interface value then that's what's in there.

I see - but that's an under-the-hood optimization, right?

conceptually, I can think of interfaces as being references to structs?

and what does "WOSSNAME" mean?


On Fri, Dec 27, 2013 at 10:40 AM, chris dollin wrote:
On 27 December 2013 14:51, Rasmus Schultz wrote:

Okay, I struggled a bit with pointers and did some reading... apparently
interfaces are *always* pointers to structs (?)
No.

If the struct (or whatever) will fit in the pointer-sized space in the
interface
value then that's what's in there.

which makes something like *interface{} completely redundant in my case.
Almost always a *interface{WOSSNAME} isn't right.

Chris
--
Chris "small bites" Dollin
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

People

Translate

site design / logo © 2022 Grokbase