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
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@siddharthab
Copy link

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
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 21, 2019
@seankhliao seankhliao added this to the Unplanned milestone Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants