ozontech / ozontech/insane-json
Feature: add function to deep copy a node from one decoder to a node from another
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes there is a need in creating a copy of JSON node subtree to another independent node to perform transformations. For this purpose it would be great to have a function to deep copy the whole data of one node to another node. There is a MutateToNode function which can do something familiar to copy, but it assigns pointers to nodes which can cause unplanned mutations. Also, when a node from one decoder is copied to a node from another via MutateToNode, if the fist node is released, its decoder is returned to pool and is prepared to be collected by GC, it might not be freed because the pointers to nodes from its pool are used in a node from another decoder and it can lead to memory leaks.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing MutateToNode function and the node and decoder ownership behavior it relies on. Trace how decoder pooling and node pointers interact, then define the deep-copy entry point so a subtree copied between decoders remains independent after the source decoder is released; verify that no source nodes or pooled decoder state are retained.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100