We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This isn't a bug in Go, but it does cause breakage elsewhere. I'm not sure what the fix should be (if any).
go version
1.7.5, 1.8
go env
Linux amd64
Ran this program:
package main import ( "encoding/json" "fmt" "log" ) func main() { b, err := json.Marshal(5e20) if err != nil { log.Fatal(err) } fmt.Println(string(b)) }
In 1.7.5, the output is 5e+20.
5e+20
In 1.8, the output is 500000000000000000000.
500000000000000000000
Both are legal JSON, but the latter breaks BigQuery:
InsertAll googleapi: Error 400: Invalid JSON payload received. Unable to parse number. [{"json":{"MyFloat":50000000000000000000 ^, badRequest
The text was updated successfully, but these errors were encountered:
Seems like a BigQuery bug. That is how Chrome formats it too. We explicitly switched formatting so we'd behave like Node.js & Chrome etc.
In Chrome:
Sorry, something went wrong.
No branches or pull requests
This isn't a bug in Go, but it does cause breakage elsewhere. I'm not sure what the fix should be (if any).
What version of Go are you using (
go version
)?1.7.5, 1.8
What operating system and processor architecture are you using (
go env
)?Linux amd64
What did you do?
Ran this program:
In 1.7.5, the output is
5e+20
.In 1.8, the output is
500000000000000000000
.Both are legal JSON, but the latter breaks BigQuery:
The text was updated successfully, but these errors were encountered: