* Create CI job to run `gen/xbuild.sh`, adjust `xbuild.sh` to make it possible
This reworks the gen/xbuild.sh script to exit with a failure if any of the targets don't compile. It also adds a CI job to try cross-compiling for every platform on every pull request.
The new check is a little slow and compute-expensive, but I am hoping it's well within the quota.
See #1299 for a demo of how the CI would have failed after #1288 and before #1295.
Screenshot: https://github.com/gokcehan/lf/assets/4123047/3d7a6b7c-8642-4d4c-a98a-c8b886c0b184
Thanks to @joelim-work for numerous improvements and an alternate
implementation I heavily borrowed from
(https://github.com/joelim-work/lf/blob/ci/gen/xbuild.sh)
* Refactor xbuild.sh some more to decrease repetition
I can remove this commit if people prefer.
* Generate darwin-arm64 binaries as we have users using it
Arm Macs are becoming popular. We have at least one
user: https://github.com/gokcehan/lf/issues/1294. It
seems lf works fine there.
* Fix Staticcheck errors & minor logic simplification
Simplify logic in ui.go. In that diff, `st` would already have the
Reversed flag set; there's no need to set it again.
Also, minor changes to remove all the statickcheck errors VS code's
Go extension complains about.
* Add staticcheck and Go 1.19 go-generate Github check
This adds a few Github action checks:
1. Check that `go fmt` and `go generate` were run on Go 1.19, following
up on https://github.com/gokcehan/lf/commit/654b8737b8a35729aa89aa93acf05ed5871b2616.
On earlier Go versions, `go generate` results in whitespace changes.
2. Check that [Staticcheck](https://staticcheck.io/) passes.