Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Copiers map[reflect.Type]CopierFunc = make(map[reflect.Type]CopierFunc)
Copiers is a map of types that behave specially when they are copied. If a type is found in this map while deep copying, this function will be called to copy it instead of attempting to copy all fields.
The key should be the type, obtained using: reflect.TypeOf(value with type).
It is unsafe to write to this map after Copies have started. If you are writing to this map while also copying, wrap all modifications to this map as well as to Copy in a mutex.
Functions ¶
Types ¶
type CopierFunc ¶
type CopierFunc func(interface{}) (interface{}, error)
CopierFunc is a function that knows how to deep copy a specific type. Register these globally with the Copiers variable.
Click to show internal directories.
Click to hide internal directories.