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: document gob format compatibility promise #13808

Closed
dsnet opened this issue Jan 3, 2016 · 2 comments
Closed

encoding/gob: document gob format compatibility promise #13808

dsnet opened this issue Jan 3, 2016 · 2 comments
Assignees
Milestone

Comments

@dsnet
Copy link
Member

@dsnet dsnet commented Jan 3, 2016

Using go1.5.

The encoding/gob package does a fair job at describing the underlying gob format as it appears on the wire. However, it makes no explicit statements about the stability of the format across different versions of Go. For example, will a gob output from go1.5 still be decodable by a hypothetical future go1.8?

The docstring for the GobEncoder type, seems to indicate that this is true given the fact that gobs can be stored:

Note: Since gobs can be stored permanently, It is good design to guarantee the encoding used by a GobEncoder is stable as the software evolves. For instance, it might make sense for GobEncode to include a version number in the encoding.

However, the fact that gobs can be stored permanently is mentioned nowhere else in the package documentation, except for the linked blog post. (In fact, most of package refers to gobs as a data interchange format to be sent over the network, rather than as a format that is suitable for disk storage.)

Can the format compatibility promise be more explicit? Perhaps in the Overview section of the package documentation? Obviously, this promise can only be kept if custom GobEncoder and BinaryMarshaler implementations remain stable. However, a promise could be made for types that do not implement those interfaces.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Jan 4, 2016
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jan 4, 2016

@robpike robpike self-assigned this Jan 4, 2016
@gopherbot
Copy link

@gopherbot gopherbot commented Apr 21, 2016

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

@gopherbot gopherbot closed this in 8082828 Apr 22, 2016
@golang golang locked and limited conversation to collaborators Apr 22, 2017
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.