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

Token incorrectly identified as Integer #435

Open
iliakap opened this issue Mar 18, 2024 · 0 comments · May be fixed by #437
Open

Token incorrectly identified as Integer #435

iliakap opened this issue Mar 18, 2024 · 0 comments · May be fixed by #437
Labels
bug Something isn't working

Comments

@iliakap
Copy link

iliakap commented Mar 18, 2024

Describe the bug
When parsing a value that is not quoted, 1x0 is inferred to be an integer with the value 0.

To Reproduce
The following YAML demonstrates the buggy behaviour

a: 1x0

Go playground example:
https://go.dev/play/p/QNg1XLBhagK

Expected behavior
I would expect the output of the above example to be
map[a:1x0], not map[a:0]

Version Variables

  • Go version: 1.22
  • go-yaml's Version: 1.11.3 (latest)

Additional context
I tried finding any documentation of such behaviour in the yaml spec, but seems like this is a bug in the tokenizer.

@iliakap iliakap added the bug Something isn't working label Mar 18, 2024
@iliakap iliakap linked a pull request Mar 19, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant