-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Copy with nested pointer to struct causes panic #31
Comments
Possible it's trying to call the |
@sudo-suhas have you found any fix for this? |
No. |
b.nested = &nested{} initialize the pointer can avoid panic. |
@qzyse2017 Can't agree, it's just a temporary solution. What if we have 300 nested field? It should be handled inside the library, if the nested field is nil, then reflect.New with the type of the field. |
Hey. Any update on this? Is fix coming to the library? |
This example uses unexported anonymous fields. Unexported fields cannot be copied to. |
The following code causes a panic:
stack trace:
The issue originates from this:
copier/copier.go
Line 71 in db4671f
Is this something that can be fixed in
copier
? I don't know enough about reflection but if you can guide me, I can make a PR to fix this.The text was updated successfully, but these errors were encountered: