deepcopier icon indicating copy to clipboard operation
deepcopier copied to clipboard

value -> ptr can't work?

Open gatspy opened this issue 5 years ago • 0 comments

code

type MenuSrc struct {
	Name string
	Code *string
	ID   uint64
}

type MenuDst struct {
	Name *string
	Code *string
	ID   uint64
}


func TestCopy(t *testing.T) {
	var name = "google"
	var dst = &MenuDst{}

	var src = &MenuSrc{
		ID:   252271854679490561,
		Name: name,
	}

	err := deepcopier.Copy(src).To(dst)
	if err != nil {
		t.Error(err)
	}
}

image

gatspy avatar Nov 22 '20 23:11 gatspy