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: cannot unmarshal e-notation number into integer type #8460

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

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 code at http://play.golang.org/p/41yjG2bL40

What happened?
Displays errors "json: cannot unmarshal number 1e2 into Go value of type
*int*" for all int types.

What should have happened instead?
No errors should be reported (and correct number should be unmarshaled).

The behaviour clearly is inline with strconv.{ParseInt,ParseUint}, but that does
arguably not agree with the JSON specification - unless int types are determined to not
be numbers.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-go1.4.

@rsc
Copy link
Contributor

rsc commented Sep 15, 2014

Comment 2:

Status changed to Duplicate.

Merged into issue #5562.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
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

4 participants