Skip to content

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

Open
@hemanth132

Description

@hemanth132

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions