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: UnmarshalText confuses json.Unmarshal #8462

Closed
kortschak opened this issue Aug 2, 2014 · 2 comments
Closed

encoding/json: UnmarshalText confuses json.Unmarshal #8462

kortschak opened this issue Aug 2, 2014 · 2 comments

Comments

@kortschak
Copy link
Contributor

What does 'go version' print?
go version go1.3 linux/amd64
go version devel +f7e7857afd88 Fri Aug 01 16:45:33 2014 -0700 linux/amd64

What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. Run the program at http://play.golang.org/p/izafDRNZFW
2. Run the program at http://play.golang.org/p/Un74tdY10R

What happened?
The first program prints a reasonably unhelpful error "error: JSON decoder out of
sync - data changing underfoot?" and the second program prints the expected result.

What should have happened instead?
Both programs should behave as the second, a more informative error should be printed,
or the json documentation should warn about use of encoding.TextUnmarshaler.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-none.

@bradfitz bradfitz removed the new label Dec 18, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc
Copy link
Contributor

rsc commented Jul 15, 2015

Dup of #9650.

@rsc rsc closed this as completed Jul 15, 2015
@golang golang locked and limited conversation to collaborators Jul 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants