Discover Packages
github.com/fufuok/utils
generic
deepcopy
package
Version:
v0.12.2
Opens a new window with list of versions in this module.
Published: Nov 16, 2023
License: MIT, MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
deepCopy
forked from smallnest/deepcopy
DeepCopy makes deep copies of things: unexported field values are not copied.
Support Embed type
Support Pointer deep copy
Support Map
Support Slice
Support Interface
Support Channel;
Forked from mohae/deepcopy and add generic support.
Usage
cpy := deepcopy.Copy[T](orig)
Expand ▾
Collapse ▴
Documentation
¶
License: MIT, for more details check the included LICENSE file.
func Copy[T any ](src T) T
Copy creates a deep copy of whatever is passed to it and returns the copy
in an interface{}. The returned value will need to be asserted to the
correct type.
type Interface interface {
DeepCopy() interface{}
}
Interface for delegating copy process to type
Source Files
¶
Click to show internal directories.
Click to hide internal directories.