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: type information missing from nested ignored interfaces #34879

Open
siddharthab opened this issue Oct 13, 2019 · 0 comments
Open

encoding/gob: type information missing from nested ignored interfaces #34879

siddharthab opened this issue Oct 13, 2019 · 0 comments

Comments

@siddharthab
Copy link

@siddharthab siddharthab commented Oct 13, 2019

What version of Go are you using (go version)?

> println(runtime.Version())
go1.13.1

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

https://play.golang.org

What did you do?

I encoded a struct with multilevel nested interfaces, and then tried to ignore the encoded value when decoding.

https://play.golang.org/p/L0f2hXG46yx

What did you expect to see?

Decoding the stream to have been successful with type information from both nested interfaces received, while ignoring the first value.

What did you see instead?

gob: bad data: field numbers out of bounds

Also, the function ignoreInterface does not descend into its fields even if the concrete type name is registered. Without descending into the concrete type, it will not be able to get type information from any more interfaces nested inside the concrete type.

// ignoreInterface discards the data for an interface value with no destination.

@siddharthab siddharthab changed the title encoding/gob: concrete type of an ignored interface should be considered encoding/gob: type information missing from nested ignored interfaces Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.