On 11/25/22 10:55, Denis P wrote:
Thank you everyone for your help.
The problem still exists.
I am looking for a solution where s and s2 point to the same instance.
The current example proves they are different instances.
https://go.dev/play/p/_JyfJelhIy4
The main goal is to store any type in a wrapper and then get the
reference of the actual struct.
Also it must be the same instance, so the println should print 2, 2, 2
But look like there is no obvious solution. :-(
There were only a couple of small mistakes. Hope an example clears it up.
https://go.dev/play/p/VhKIokDPCdq
--
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/c4fa8fbb-27cb-2ef1-ec80-2444c1ff7f73%40mb0.org.