copier icon indicating copy to clipboard operation
copier copied to clipboard

fix json error when struct field is slice and is nil

Open hemanth132 opened this issue 3 years ago • 0 comments

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.

hemanth132 avatar May 08 '22 17:05 hemanth132