I had several issue copying a structure to another which contain pointers.
It seems that if your structure cointain some pointer to another struct, the pointer address from the source is copied rather than building a new object and set the value of the pointer to the new instance.
So when you change the value of the destination object for instance, you will automatically change the value of the source ... which is not what I / (we ?) expect.
I shared the example here
I think that is a huge issue
Reproducible Example
https://play.golang.org/p/dGhNPDZQtPu
Description
Hi everyone,
I had several issue copying a structure to another which contain pointers.
It seems that if your structure cointain some pointer to another struct, the pointer address from the source is copied rather than building a new object and set the value of the pointer to the new instance.
So when you change the value of the destination object for instance, you will automatically change the value of the source ... which is not what I / (we ?) expect.
I shared the example here I think that is a huge issue
Thanks in advance :) !
@jinzhu