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

Comments

Projects
None yet
5 participants
@kortschak
Copy link
Contributor

commented Aug 2, 2014

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

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2014

Comment 1:

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

@kortschak kortschak added new labels Aug 2, 2014

@bradfitz bradfitz removed the new label Dec 18, 2014

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed release-none labels Apr 10, 2015

@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 15, 2015

Dup of #9650.

@rsc rsc closed this 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.
You can’t perform that action at this time.