4 ms·
I especially love gojq thanks to this change: $ echo '{"alpha":"beta"}' | jq -r '"hello \(.alpha\)"' jq: error: syntax error, unexpected INVALID_CHARAC
by mdaniel 4y ago
I especially love gojq thanks to this change:
$ echo '{"alpha":"beta"}' | jq -r '"hello \(.alpha\)"'
jq: error: syntax error, unexpected INVALID_CHARACTER (Unix shell quoting issues?) at <top-level>, line 1:
"hello \(.alpha\)"
jq: 1 compile error
$ echo '{"alpha":"beta"}' | gojq -r '"hello \(.alpha\)"'
gojq: invalid query: "hello \(.alpha\)"
"hello \(.alpha\)"
^ unexpected token "\\"
because (a) muscle memory (b) sure, it's easy to spot that mistake in an 18 character expression, but for bigger ones, getouttahere
- gregmac 4y agoThere's a particularly complicated system I built a few years ago that heavily leaned on jq for configuring some backend systems. It had lots of variables piped in and so that particular error was common. From your snippet, I'm pretty sure gojq would have saved me many hours of debugging.
- raverbashing 4y agoYeah the ergonomy and error messaging of jq is complicated I'm not a big fan of the language, but it works