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

fix json decode #424

Merged
merged 11 commits into from
Jun 26, 2023
Merged

fix json decode #424

merged 11 commits into from
Jun 26, 2023

Conversation

geseq
Copy link
Collaborator

@geseq geseq commented Jun 25, 2023

No description provided.

@geseq geseq marked this pull request as ready for review June 25, 2023 16:46
@geseq
Copy link
Collaborator Author

geseq commented Jun 25, 2023

@d5 can I get a review on this please?

@d5
Copy link
Owner

d5 commented Jun 25, 2023

Looks good. Just curious how stdlib implementation handles this. Have you looked at it?

@geseq
Copy link
Collaborator Author

geseq commented Jun 26, 2023

It looks like go stdlib uses the type provided by the variable into which it is unmarshaling.

So if you specify an int, it’ll unmarshal as int when legal. If the type provided is any it does float64.

tengo has to figure out the correct type by itself.

@geseq geseq merged commit 48308d4 into d5:master Jun 26, 2023
@geseq geseq deleted the json-decide-fix branch June 26, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants