itchyny / gojq

Pure Go implementation of jq
MIT License
3.3k stars 119 forks source link

Trim white space for tonumber for jq compatibility #243

Closed wader closed 8 months ago

wader commented 8 months ago

$ jq -n '" 123 " | tonumber' 123

$ gojq -n '" 123 " | tonumber' gojq: tonumber cannot be applied to " 123 ": invalid number

wader commented 8 months ago

Closing. jq will be made stricter and match gojq's behaviour instead https://github.com/jqlang/jq/pull/3055