mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-17 03:02:28 +08:00
fix: update param type of CopyProperties
This commit is contained in:
@@ -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.
|
// CopyProperties copies each field from the source into the destination. It recursively copies struct pointers and interfaces that contain struct pointers.
|
||||||
// Play: todo
|
// Play: todo
|
||||||
func CopyProperties(dst, src interface{}) (err error) {
|
func CopyProperties[T, U any](dst T, src U) (err error) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if e := recover(); e != nil {
|
if e := recover(); e != nil {
|
||||||
err = errors.New(fmt.Sprintf("%v", e))
|
err = errors.New(fmt.Sprintf("%v", e))
|
||||||
|
|||||||
Reference in New Issue
Block a user