deepcopy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package deepcopy provides recursive deep-copy helpers for JSON-shaped data — values decoded into map[string]any / []any trees. Copying such a tree lets a caller hand it to other code (e.g. an extension or a background goroutine) without risking mutation of, or data races on, the original.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map(m map[string]any) map[string]any

Map returns a deep copy of m, recursing into nested values via Value. It returns nil if m is nil.

func Value

func Value(v any) any

Value returns a deep copy of v, recursing into map[string]any and []any so that no map or slice is shared between the input and the result. Scalars (strings, numbers, bools, nil) and any other types are returned as-is: they are either immutable or fall outside the JSON value model handled here.

Types

This section is empty.

Jump to

Keyboard shortcuts

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