refactor: 移除 reflects.DeepCopy 无效函数

This commit is contained in:
kercylan98 2023-12-29 14:20:50 +08:00
parent cf42ed649a
commit a7b0497d4f
1 changed files with 0 additions and 10 deletions

View File

@ -1,20 +1,10 @@
package reflects
import (
"fmt"
"reflect"
"unsafe"
)
// DeepCopy 深拷贝
func DeepCopy[T any](src T) T {
vof := reflect.Indirect(reflect.ValueOf(src))
tof := vof.Type()
fmt.Println(tof)
return src
}
// GetPtrUnExportFiled 获取指针类型的未导出字段
func GetPtrUnExportFiled(s reflect.Value, filedIndex int) reflect.Value {
v := s.Elem().Field(filedIndex)