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
Assignees
Milestone

Comments

@divVerent
Copy link

@divVerent divVerent commented Jun 8, 2015

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

@gopherbot gopherbot commented Sep 17, 2015

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

@robpike robpike closed this in 1216e18 Sep 17, 2015
@divVerent
Copy link
Author

@divVerent divVerent commented Sep 17, 2015

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

@golang golang locked and limited conversation to collaborators Sep 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.