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

Copy didn't success, error should be returned #150

Open
harrisonho99 opened this issue Jun 19, 2022 · 0 comments
Open

Copy didn't success, error should be returned #150

harrisonho99 opened this issue Jun 19, 2022 · 0 comments
Assignees

Comments

@harrisonho99
Copy link

Unsuccessful copy, expected error return

	src := struct{ Name string }{Name: "harrison"}
	dst := make(map[string]interface{})

	err := copier.CopyWithOption(&dst, src, copier.Option{DeepCopy: true})
	if err != nil { // if copy didn't success, error should be returned
		panic(err)
	}

	fmt.Println(dst) // empty map

Description

https://goplay.tools/snippet/ra4iaMjkHnl

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