deepcopy

package
v3.54.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map[K comparable, V any](orig map[K]V) map[K]V

func OrderedMap added in v3.41.0

func OrderedMap[K comparable, V any](orig *orderedmap.OrderedMap[K, V]) *orderedmap.OrderedMap[K, V]

func Scalar added in v3.48.0

func Scalar[T any](orig *T) *T

func Slice

func Slice[T any](orig []T) []T

func TraverseStringsFunc added in v3.36.0

func TraverseStringsFunc[T any](v T, fn func(v string) (string, error)) (T, error)

TraverseStringsFunc runs the given function on every string in the given value by traversing it recursively. If the given value is a string, the function will run on a copy of the string and return it. If the value is a struct, map or a slice, the function will recursively call itself for each field or element of the struct, map or slice until all strings inside the struct or slice are replaced.

Types

type Copier

type Copier[T any] interface {
	DeepCopy() T
}

Jump to

Keyboard shortcuts

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