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
Problems with unmarshalling of structs with interface fields #261
Comments
Here is the code on the Go playground: https://play.golang.org/p/2RpoOtWkhYi |
This is not an issue about msgpack. This is an issue about your expectation that it would be possible to deserialize into an interface. I have converted your example to use |
I believe this is not working in v5 |
This is not strictly true. The gob serializer can encode the concrete type underlying an interface and unmarshal on the other side. |
@vmihailenco Can you reopen this issue because the behavior is still the same with v5 |
The difference is that |
Here's an example of how to use |
Hi! I try to use Msgpack to marshal structs with interface fields. During the unmarshal, the library panics. Here is an example: https://gist.github.com/giggsoff/b261040fb97f9ff8f81145a5ed440ec3
And I got:
When I initialize struct before unmarshalling to it here https://gist.github.com/giggsoff/65606a03d84288000f0cd01684eb1b48
I got wrong result (expected result is the same lines):
And I cannot use library in app lf-edge/adam#32
The text was updated successfully, but these errors were encountered: