/// 2>/dev/null; gorun "$0" "$@" ; exit $?
Seems to me the best combination of the answers thus far. It uses gorun
so it caches the compilation step (which speeds up your scripts greatly), and works on macOS, too.
Install gorun
with:
go get github.com/erning/gorun