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

Add Support to Copy zero length Slice #63

Open
koota110 opened this issue Sep 25, 2020 · 2 comments
Open

Add Support to Copy zero length Slice #63

koota110 opened this issue Sep 25, 2020 · 2 comments

Comments

@koota110
Copy link

koota110 commented Sep 25, 2020

res := []SampleArray{}
if err := copier.Copy(&SampleArray, sourceArray); err != nil {
	return nil, errors.Wrap(err, "failed to copy response")
}

if sourceArray is zero length array then res is nil !!

i want res is zero length array!!

@math-nao
Copy link
Contributor

Could you please give a full test to run?

@rahulkhairwar
Copy link
Contributor

@koota110 please look at this piece of code : https://play.golang.org/p/Ihqb0zTa8n0
I'm not able to reproduce the issue you've reported.
I think this ticket can be closed.
@jinzhu

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

3 participants