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.
Reproducible Example
Added a testcase and the code fix for the same here: https://github.com/jinzhu/copier/pull/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.