Skip to content

Backtrace error with hexadecimal value preceded by a sign #2748

@jonathanpoelen

Description

@jonathanpoelen

Describe the bug

When a + or - sign is placed before a number in hexadecimal format, an error occurs when MarshalJSON is called.

Version of yq: v4.53.2
Operating system: Manjaro Linux
Installed via: pacman (package manager)

Input Yaml

+0x12

or

-0x12

Command
The command you ran:

yq <<<'+0x12'

Actual behaviour

Error: json: error calling MarshalJSON for type *yqlib.CandidateNode: strconv.ParseInt: parsing "+0x12": invalid syntax

Expected behaviour

No error and show 18.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions