INNER CODE UNIT · Go
TestCopyWithConverterAndAnnotation
jinzhu/copier · copier_converter_test.go:98
func TestCopyWithConverterAndAnnotation(t *testing.T) {
type SrcStruct struct {
Field1 string
}
type DestStruct struct {
Field1 string
Field2 string `copier:"Field1"`
}
src := SrcStruct{
Field1: "test",
}
var dst DestStruct
err := copier.CopyWithOption(&dst, &src, copier.Option{
IgnoreEmpty: true,