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

encoding/gob: merges maps instead of replacing #11117

Closed
divVerent opened this issue Jun 8, 2015 · 2 comments
Closed

encoding/gob: merges maps instead of replacing #11117

divVerent opened this issue Jun 8, 2015 · 2 comments

Comments

@divVerent
Copy link

go version: Whatever is on play.golang.org.

Operating system: Linux

What I did: used gob.Decoder.Decode to an already existing map. See: http://play.golang.org/p/yjPCjdHp93

What I expected: the map passed to Decode will be entirely overwritten by the gobbed input map.

What I got: the map passed to Decode got merged with the gobbed input map.

At the very least, the decoder merging instead of replacing maps should be documented.

@gopherbot
Copy link

CL https://golang.org/cl/14693 mentions this issue.

@divVerent
Copy link
Author

Yes, this explanation is good and resolves the issue for me.

@golang golang locked and limited conversation to collaborators Sep 22, 2016
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants