Hi! :-) 

I'm still a newbie. I've got a factory function for objects, and the newly 
created object is given out by a return statement.

But it seems the original object gets copied (no "move semantics") and gets 
garbage collected. Anyway, in my program, my custom finalizer (set with 
runtime.SetFinalizer) gets called on it, unless I use pointers.

My first question was whether I understand this correctly at all.

...

And, in general I will try to use value-ish code. Because it looks neat and 
the stuff to copy isn't too much when I don't have a lot fields. And when I 
have custom finalizers I can still use pointers to objects.

Or would I better let all factories (even thouse without custom finalizer) 
give out pointers?

Kind regards
Mark

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to