copyKit

package
v1.30.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepCopy

func DeepCopy[T any](src T) (dest T, err error)

DeepCopy 深拷贝,支持: slice、map、结构体...

PS: 参考: 「Go工具箱」推荐一个非常简单的深拷贝工具:deepcopy https://mp.weixin.qq.com/s/e3bL1i6WT-4MwK-SEpUa6Q

@param src 指针 || 结构体实例 @return e.g. (interface{}(nil)) => (nil, nil)

func DeepCopyStruct deprecated

func DeepCopyStruct(toValue interface{}, fromValue interface{}) error

DeepCopyStruct 深拷贝结构体

Deprecated: 不支持map,因为结果为浅拷贝.

@param toValue 必须是指针类型 @param fromValue 指针类型 || 结构体实例

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL