-
Notifications
You must be signed in to change notification settings - Fork 236
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
Fix interface conversion from int types to float64 #741
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
4803df9
to
92a842f
Compare
Can we get a chance to review this pull request? |
@@ -950,7 +950,8 @@ func jsonToValue(i *interpreter, v interface{}) (value, error) { | |||
case bool: | |||
return makeValueBoolean(v), nil | |||
case int, int8, int16, int32, int64: | |||
return makeDoubleCheck(i, v.(float64)) | |||
val, _ := v.(int64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why we need to convert the value to int64
.
Is the following code wrong?
return makeDoubleCheck(i, float64(v))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
makeDoubleCheck(i, float64(v))
causes a compile error.
cannot convert v (variable of type interface{}) to type float64: need type assertion
I'm trying this pull request, but this doesn't work as expected. |
Closing in favour of #753 |
No description provided.