Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #1388 #1389

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix issue #1388 #1389

wants to merge 1 commit into from

Conversation

zzr93
Copy link

@zzr93 zzr93 commented Mar 16, 2023

As issue #1388 reported, this situation is about implementing a deep copy method for a map, #1388 illustrates the problem cause by using Json Marshal/Unmarshal, here are some other choices:

  1. Iterating over the old map and assign key-value pairs to the new map. But dealing with embed values can be ineffective and complex.
  2. Using gob. The problem is custom structs need to be registered first, but this situation doesn't contain any custom struct.

It seems custom structs would not appear in this situation, so I chose gob finally.

Signed-off-by: zzr93 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant