However, there are quite a few typos in the examples... even the very first one is missing a quote and won't parse if cut-and-pasted as is.
However, there are quite a few typos in the examples... even the very first one is missing a quote and won't parse if cut-and-pasted as is.
I do my scripting mostly in Go now and it's much easier to structure my code and grow it over time. I sometimes use Python, but Go is more flexible for what I do. I can compile an exe and drop it onto a host and run it, without worrying about VM and library versioning (or in Bash's case, making sure jq is installed and all the Unix utils have compatible versions).
I don't know what you mean by "memory-management-free" though, Go is still a garbage collected language.
Also I recently learned Go's CLI parser is pretty weak compared to argparse.
(bash doesn't care about errors either, by the way.)
And handling errors in concurrent code is consistent--still passed as values. Languages with implicit stack-unwinding exceptions have inconsistent ways to deal with the errors because, in concurrent programs, error handling doesn't end once the stack is unwound, because there are lots of concurrent stacks. You then usually catch the exception near the top of the stack and pass it to another stack...as a value.
So yes, there is some boilerplate involved in that. But as a codebase grows, I appreciate that the language encourages me and others to be intentional about how errors are handled, and also provides a consistent mechanism for handling them in concurrent code (concurrency is a big reason I use Go to begin with).