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: encode(decode(encode(x))) != encode(x) when using with RPC together. #2531

Closed
gopherbot opened this issue Dec 6, 2011 · 2 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Dec 6, 2011

by AwakenRz:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull", "hg update default", rebuild, and
retry
what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Compile the attachement using 6g
2. Run the executable.
3. Run the executable again.

What is the expected output?
[14 255 133 4 1 2 255 134 0 1 4 1 4 0 0 4 255 134 0 0] 
should be seen in every run.
At least it should be something the same among different runs of the program.

What do you see instead?
[14 255 133 4 1 2 255 134 0 1 4 1 4 0 0 4 255 134 0 0] 
is outputted the first time you run the code and 
[14 255 129 4 1 2 255 130 0 1 4 1 4 0 0 4 255 130 0 0] 
is outputted the second time you run it.
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Mac OS X 10.7.2

Which revision are you using?  (hg identify)
6g version release.r60.3 9924
6l version release.r60.3 9924

Please provide any additional information below.

Attachments:

  1. rpc.go (1161 bytes)
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 6, 2011

Comment 1:

You are looking for a feature that the gob package does not document and does not
provide.  Use the encoding/binary package instead.

Status changed to WorkingAsIntended.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Dec 7, 2011

Comment 2 by AwakenRz:

But encoding/binary does not support map
@mikioh mikioh changed the title gob encoder/decoder: encode(decode(encode(x))) != encode(x) when using with RPC together. encoding/gob: encode(decode(encode(x))) != encode(x) when using with RPC together. Feb 26, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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
2 participants
You can’t perform that action at this time.