deepcopy

package
v3.37.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 1 Imported by: 0

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