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/json: Bug with anonymous struct fields #5245

Closed
AlekSi opened this issue Apr 9, 2013 · 5 comments

Comments

Projects
None yet
4 participants
@AlekSi
Copy link
Contributor

commented Apr 9, 2013

What steps will reproduce the problem?
Run this program with Go from tip: http://play.golang.org/p/mwOdp6ONTm

What is the expected output?
{"S":"B"} (as in Go 1.0, also matches v.S)

What do you see instead?
{}
@AlekSi

This comment has been minimized.

Copy link
Contributor Author

commented Apr 9, 2013

Comment 1:

Same problem with unmarshal: http://play.golang.org/p/MeynbK3nGT
@robpike

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2013

Comment 2:

This looks like a bad regression

Labels changed: added priority-soon, go1.1, removed priority-triage.

Status changed to Accepted.

@robpike

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2013

Comment 3:

The code at the end of typefields is mistakenly killing off both fields because it
thinks there's a collision on S
@robpike

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2013

Comment 4:

Labels changed: added priority-asap, removed priority-soon.

Status changed to Started.

@robpike

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2013

Comment 5:

This issue was closed by revision 357e37d.

Status changed to Fixed.

@AlekSi AlekSi added fixed labels Apr 9, 2013

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015

@rsc rsc removed the go1.1 label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.