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

Unmarshaling is incorrect, particularly around numbers. #55

Open
beiriannydd opened this issue Jun 26, 2019 · 0 comments
Open

Unmarshaling is incorrect, particularly around numbers. #55

beiriannydd opened this issue Jun 26, 2019 · 0 comments

Comments

@beiriannydd
Copy link

beiriannydd commented Jun 26, 2019

Minimal example

https://play.golang.org/p/jZK6kGxo_vB

for '--- 1' og vs output: (int)1!=(float64)1
for '--- 031' og vs output: (int)25!=(float64)25
for '--- 031' ogoutstring vs outstring: 031!=25
for '--- 031' ogoutnum vs outnum: 031!=25
for '--- {"hi":031}' og vs output: (map[interface {}]interface {})map[hi:25]!=(map[string]interface {})map[hi:25]
err: error unmarshaling JSON: json: cannot unmarshal object into Go value of type string
err: error unmarshaling JSON: json: cannot unmarshal object into Go value of type json.Number

I'm ok with many of these. What I really want though is for json.Number to be decoded without 0 truncation and octal conversion as the OG yaml library does.

@beiriannydd beiriannydd changed the title Marshaling is incorrect, particularly around numbers. Unmarshaling is incorrect, particularly around numbers. Jun 26, 2019
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

No branches or pull requests

1 participant