Documentation ¶
Overview ¶
The deepcopy package implements deep copying of arbitrary data structures, making sure that self references and shared pointers are preserved.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy(obj interface{}) (r interface{})
Copy makes a recursive deep copy of obj and returns the result.
Pointer equality between items within obj is preserved, as are the relationships between slices that point to the same underlying data, although the data itself will be copied. a := Copy(b) implies reflect.DeepEqual(a, b). Map keys are not copied, as reflect.DeepEqual does not recurse into map keys. Due to restrictions in the reflect package, only types with all public members may be copied.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.