Registry / utility / mohae-deepcopy

mohae-deepcopy

JSON →
library0.0.0-20170929034955-c48cc78d4826gogounverified

deepcopy makes deep copies of Go data structures, handling pointers, slices, maps, and structs.

go get github.com/mohae/deepcopy
INSTALL
IMPORT
SIG · MOHAE-DEEPCOPY
M
mohae-deepcopy
utilitygov0.0.0-20170929034955-c48cc78d4826
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

deepcopy
github.com/mohae/deepcopy

Deep copy a map and modify the copy without affecting the original.

package main import ( "fmt" "github.com/mohae/deepcopy" ) func main() { original := map[string]int{"a": 1, "b": 2} copy := deepcopy.Copy(original).(map[string]int) copy["a"] = 99 fmt.Println(original["a"]) // Output: 1 }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20170929034955-c48cc78d4826latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mohae-deepcopy — go get mohae-deepcopy · libregistry