go-lang() { if [ "$(which go | wc -l)" -eq 1 ]; then if [ -z "$1" ]; then echo "build - Compile packages and dependencies." echo "download - Downloads the module to local cache." echo "init - Init new module in current DIR." echo "get - Adds dependencies to current module and install them." echo "tidy - Add missing and remove unused modules." echo "vendor - Make vendored copy of dependencies." else case "$1" in build) go build;; download) go mod download;; init) go mod init "$2";; get) go get "$2";; tidy) go mod tidy;; vendor) go mod vendor;; *) go-lang;; esac fi else echo "Go Lang, not install yet!" echo "Goto: https://go.dev/dl/ Grab the TAR file..." echo "rm -rf /usr/local/go && tar -C /usr/local -xzf GO_FILE_HERE.tar.gz" echo "ln -s /usr/local/go/bin/go /usr/local/bin/" fi } alias gx='go-lang'