From f08b368001b4ee7cbe7c3ec38727e26918a2f8d9 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Mon, 20 Feb 2023 14:04:45 +0800 Subject: [PATCH] fix: update param type of CopyProperties --- convertor/convertor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convertor/convertor.go b/convertor/convertor.go index e40b93b..083c4d3 100644 --- a/convertor/convertor.go +++ b/convertor/convertor.go @@ -344,7 +344,7 @@ func DeepClone[T any](src T) T { // CopyProperties copies each field from the source into the destination. It recursively copies struct pointers and interfaces that contain struct pointers. // Play: todo -func CopyProperties(dst, src interface{}) (err error) { +func CopyProperties[T, U any](dst T, src U) (err error) { defer func() { if e := recover(); e != nil { err = errors.New(fmt.Sprintf("%v", e))