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

fix json error when struct field is byte slice and is nil #143

Open
hemanth132 opened this issue May 8, 2022 · 0 comments
Open

fix json error when struct field is byte slice and is nil #143

hemanth132 opened this issue May 8, 2022 · 0 comments
Assignees

Comments

@hemanth132
Copy link

Reproducible Example

Added a testcase and the code fix for the same here: #142

Description

When using copier for a struct with a nil byte slice as a field to a target struct which contains a similar nil byte slice field, the target slice field is being set with an empty slice instead of nil.

This cause issues, when the resulting target slice is converted to json using json.Marsha() method. Added a testcase for the same.

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

2 participants