Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeepCopy is not handling interface pointers well #100

Open
JonathanAquino opened this issue May 21, 2021 · 2 comments
Open

DeepCopy is not handling interface pointers well #100

JonathanAquino opened this issue May 21, 2021 · 2 comments
Assignees

Comments

@JonathanAquino
Copy link

Reproducible Example

https://play.golang.org/p/x1EO_KR_ARr

Description

When I ask copier to DeepCopy a struct with a property that is an interface pointer, that property is not copied properly.

The expected output of the Golang Playground example above is:

*car.TireCount: 4
*car.CopyTireCount: 4

But the actual output is:

*car.TireCount: 4
*car.CopyTireCount: 824633787184
@JonathanAquino
Copy link
Author

Note that the reprint deep-copy library does not have this problem:

https://play.golang.org/p/_vfUwBVw5oi

cc @qdm12

@qdm12
Copy link

qdm12 commented May 22, 2021

I think that's why I started that reprint library, as other libs wouldn't deep copy pointers properly... although I haven't touched in for more than a year, I have no idea how I coded that 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants