type A struct{
v int
}
type B struct{
*A
}
b:=B{new(A)}
c:=b
b.v=2
println(c.v)//2 not 0
My problem is illustrated in the above code. I don't quite understand what is happening here, I assume it's that the v belongs to .A which is a pointer, so copying doesn't copy the value, but I'm not sure. Also, is there a way to solve this problem? I can't change the embed to value because i need the methods on pointer receivers.