To keep a reference to a set of objects in a slice, must it be of type []*T 
?

Is there a more elegant way to handle the following example?

https://play.golang.org/p/73lfAntNzb

tryref.id is an immutable value type and try.others is a reference type 
correct? can you explain why the id is copied properly but the reference to 
the object as well as tryref.others are not?

I assume its because golang is pass by value and the type of tryref.others 
is not a pointer so when appending an object it creates a new instance.

-- 
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