Discover Packages
github.com/ddkwork/golibrary
stream
deepcopy
package
Version:
v0.0.34
Opens a new window with list of versions in this module.
Published: May 24, 2024
License: Apache-2.0
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
DeepCopy makes deep copies of things: unexported field values are not copied.
Usage
cpy := deepcopy.Copy(orig)
Expand ▾
Collapse ▴
Documentation
¶
deepcopy makes deep copies of things. A standard copy will copy the
pointers: deep copy copies the values pointed to. Unexported field
values are not copied.
Copyright (c)2014-2016, Joel Scoble (github.com/mohae), all rights reserved.
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 any. The returned value will need to be asserted to the
correct type.
Iface is an alias to Copy; this exists for backwards compatibility reasons.
type Interface interface {
DeepCopy() any
}
Interface for delegating copy process to type
Source Files
¶
Click to show internal directories.
Click to hide internal directories.