Hello,

My question is general, but for ease of communicating I'll use the specific 
example I ran into.

I'm very new and for my first project I'm working with the bleve library 
[https://pkg.go.dev/github.com/blevesearch/bleve].

One function I need, "Open", returns an interface, "Index".

I'd like to write my own function to act on this interface, and given that 
I have no idea what the dynamic value of the interface is, my first 
instinct is to rather pass a pointer to the returned interface into my 
function.

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?
My worry is that I have no idea what dynamic type is lurking within the 
interface, if it's a pointer to a struct, then I obviously don't mind 
passing it into my function.

However if it is in fact a humungous 1GB struct, then I really really don't 
want to be copying that around willy-nilly.

Is there a way in general to avoid this, without looking at the library 
source code to see what the actual concrete type is?

-- 
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/26220c11-a9bc-4d08-b536-e1909b97e8b4n%40googlegroups.com.

Reply via email to