deepcopy

package
v0.0.0-...-f3d8a94 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2018 License: MIT Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

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