Hacker News new | past | comments | ask | show | jobs | submit login

then use -s :

        jo -- -s opaque_id=001979
        {"opaque_id":"001979"}



jo opaque_id=$(command used in prod that returns digits + letters for three months and everything works just fine and then suddenly at 3am on a Sunday it returns 1979 and breaks everything)

Avoid using this command in prod.


    jo -- -s a=123 -s b=00123 -s c="$(date)"
    {"a":"123","b":"00123","c":"Sat  5 Feb 21:29:08 GMT 2022"}
What's the issue?


The problem is avoiding your surprise ruined Sunday night three months from now is predicated on you not forgetting to put the -s in.

Implicit typing sucks: https://www.destroyallsoftware.com/talks/wat


Agreed, luckily there is a solution ;)


It’s not a solution, it’s a work-around. A solution would be fixing this issue. This allows working around the issue if you remember that it exists.

It’s like saying that it’s fine if an appliance might randomly burn your house, because there’s a button you can press to not burn your house.


I'm sure it'd be a patch of a few lines to make the type specification mandatory on the command line (I would certainly prefer that also), but it comes down to the opinion of the maintainer if that is wanted or not.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: