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

How about support GoStruct encode? #6

Open
eyotang opened this issue Dec 20, 2017 · 2 comments
Open

How about support GoStruct encode? #6

eyotang opened this issue Dec 20, 2017 · 2 comments

Comments

@eyotang
Copy link

eyotang commented Dec 20, 2017

Is it possible to realize the encode function of GoStrucy?

@leewz
Copy link

leewz commented Nov 1, 2018

I started working on that in my branch, but I got stuck when it came to nested types.

For example

  1. You have a custom type X.
  2. And a custom type Y which contains an X.
  3. You dump an object of type Y.

My dumper will detect the need to dump a description of Y, but it won't detect that X has also been dumped, so it won't dump a description of X.

As a workaround, you could manually encode the types into the stream, or, if modifying an existing gob, save and reuse the type headers from the original gob.

@andrewelkin
Copy link

I agree. Supporting things like named tuples it would be much more useful..

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

No branches or pull requests

3 participants