refactor: 移除 reflects.DeepCopy 无效函数
This commit is contained in:
parent
cf42ed649a
commit
a7b0497d4f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue