Registry / utility / huandu-go-clone

huandu-go-clone

JSON →
library1.7.3gogounverified

This package provides functions to deep clone any Go data and protect pointers from unexpected mutations.

go get github.com/huandu/go-clone
INSTALL
IMPORT
SIG · HUANDU-GO-CLONE
H
huandu-go-clone
utilitygov1.7.3
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.

clone
github.com/huandu/go-clone

Deep clones a map and modifies the copy without affecting the original.

package main import ( "fmt" "github.com/huandu/go-clone" ) func main() { original := map[string]int{"a": 1, "b": 2} copied := clone.Clone(original).(map[string]int) copied["a"] = 99 fmt.Println("Original:", original) fmt.Println("Copied:", copied) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.7.3latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
huandu-go-clone — go get huandu-go-clone · libregistry