Registry / utility / getlantern-deepcopy

getlantern-deepcopy

JSON →
library0.0.0-20160317154340-7f45deb8130agogounverified

Package deepcopy provides functionality for making deep copies of objects using JSON marshal/unmarshal.

go get github.com/getlantern/deepcopy
INSTALL
IMPORT
SIG · GETLANTERN-DEEPCOP
G
getlantern-deepcopy
utilitygov0.0.0-20160317154340-7f45deb8130a
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/getlantern/deepcopy

Deep copy a map using JSON serialization

import "github.com/getlantern/deepcopy" func main() { src := map[string]int{"a": 1} var dst map[string]int deepcopy.Copy(&dst, &src) }
Debug
Known issues
gotchaUses JSON marshal/unmarshal, which may not handle all types (e.g., channels, functions).
fix
Ensure the object is JSON-serializable or use a more robust deep copy library.
affects: all
Upgrade
Version history
0.0.0-20160317154340-7f45deb8130alatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

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