News for hackers. Stuff that matters.
Re:I can't believe I'm praising Tcl (2008) by IggleSniggle on Monday September 07, 2020 @08:38AM (#24399010)
That is one interesting shebang. Nicely done. Can you explain the error handling stuff?
Re:I can't believe I'm praising Tcl (2008) by gurjeet on Friday September 11, 2020 @02:17AM (#24439695)
There are functions in log.go that emit message to stdout (thinking about it, I need to send warnings and above to stderr).

The function err(), in addition to sending a message to stdout, also causes an exit of the process. But it does so only if ExitOnError is turned on; which is on by default, and can be turned off by setting environment variable EXIT_ON_ERROR=true.

I have converted that Gist into a standalone Git repo, and hope to update it to add more improvements (like the stderr change, above) to showcase how to leverage GoLang for scripting.

[1]: https://git.sr.ht/~gurjeet/GoLang_Scripting_Example