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

[bug] panic in copying slices >v0.2.0 #75

Closed
v-byte-cpu opened this issue Jan 15, 2021 · 0 comments
Closed

[bug] panic in copying slices >v0.2.0 #75

v-byte-cpu opened this issue Jan 15, 2021 · 0 comments
Assignees

Comments

@v-byte-cpu
Copy link

v-byte-cpu commented Jan 15, 2021

Reproducible Example

type CollectionAlias struct {
	CollectionName string `json:"collection_name"`
	Name string `json:"name"`
}

func createNewCollectionAlias(collectionName string, name string) *api.CollectionAlias {
	return &api.CollectionAlias{
		CollectionName: collectionName,
		Name:           name,
	}
}

...

	expectedResult := []*api.CollectionAlias{
		createNewCollectionAlias("collection", "collection_alias1"),
		createNewCollectionAlias("collection", "collection_alias2"),
		createNewCollectionAlias("collection", "collection_alias3"),
	}

	mockedResult := []*api.CollectionAlias{}
	copier.Copy(&mockedResult, &expectedResult) // <--- panic here

Description

This bug is reproducible for all versions > v0.2.0

You can get more details here.

@v-byte-cpu v-byte-cpu changed the title panic in copying slices panic in copying slices >v0.2.0 Jan 15, 2021
@v-byte-cpu v-byte-cpu changed the title panic in copying slices >v0.2.0 [bug] panic in copying slices >v0.2.0 Jan 15, 2021
@jinzhu jinzhu closed this as completed in c4beccc Mar 9, 2021
tomtwinkle pushed a commit to tomtwinkle/copier that referenced this issue Mar 19, 2021
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