clonerex

package
v1.90.4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package clonerex is an example package for the cloner tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(dst, src any) bool

Clone duplicates src into dst and reports whether it succeeded. To succeed, <src, dst> must be of types <*T, *T> or <*T, **T>, where T is one of SliceContainer,InterfaceContainer.

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 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 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.

Jump to

Keyboard shortcuts

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