Documentation
¶
Overview ¶
Package clonerex is an example package for the cloner tool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cloneable ¶ added in v1.90.0
type Cloneable interface {
Clone() Cloneable
}
Cloneable is an interface with a Clone method.
type CloneableImpl ¶ added in v1.90.0
type CloneableImpl struct {
Value int
}
CloneableImpl is a concrete type that implements Cloneable.
func (*CloneableImpl) Clone ¶ added in v1.90.0
func (c *CloneableImpl) Clone() Cloneable
type DeeplyNestedMap ¶ added in v1.92.0
type DeeplyNestedMap struct {
ThreeLevels map[string]map[string]map[string]int
FourLevels map[string]map[string]map[string]map[string]*SliceContainer
}
DeeplyNestedMap tests arbitrary depth of map nesting (3+ levels)
func (*DeeplyNestedMap) Clone ¶ added in v1.92.0
func (src *DeeplyNestedMap) Clone() *DeeplyNestedMap
Clone makes a deep copy of DeeplyNestedMap. The result aliases no memory with the original.
type InterfaceContainer ¶ added in v1.90.0
type InterfaceContainer struct {
Interface Cloneable
}
InterfaceContainer has a pointer to an interface field, which tests the special handling for interface types in the cloner.
func (*InterfaceContainer) Clone ¶ added in v1.90.0
func (src *InterfaceContainer) Clone() *InterfaceContainer
Clone makes a deep copy of InterfaceContainer. The result aliases no memory with the original.
type MapWithPointers ¶ added in v1.92.0
type MapWithPointers struct {
Nested map[string]*int
WithCloneMethod map[string]*SliceContainer
CloneInterface map[string]Cloneable
}
func (*MapWithPointers) Clone ¶ added in v1.92.0
func (src *MapWithPointers) Clone() *MapWithPointers
Clone makes a deep copy of MapWithPointers. The result aliases no memory with the original.
type SliceContainer ¶
type SliceContainer struct {
Slice []*int
}
func (*SliceContainer) Clone ¶
func (src *SliceContainer) Clone() *SliceContainer
Clone makes a deep copy of SliceContainer. The result aliases no memory with the original.