Skip to content

Commit

Permalink
refactor: 移除 reflects.DeepCopy 无效函数
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Dec 29, 2023
1 parent cf42ed6 commit a7b0497
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions utils/reflects/struct.go
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit a7b0497

Please sign in to comment.