From 50f0314b6e835b351d5a6c77c7f820d1cf031c59 Mon Sep 17 00:00:00 2001 From: Spekulaas Date: Mon, 26 Sep 2022 16:00:50 +0200 Subject: [PATCH] install latest version of go --- src/applications/golang.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 src/applications/golang.sh diff --git a/src/applications/golang.sh b/src/applications/golang.sh new file mode 100755 index 0000000..e84efaf --- /dev/null +++ b/src/applications/golang.sh @@ -0,0 +1,17 @@ +# Get the full html and get the link of the button +wget https://go.dev/dl/ + +# get latest Linux download row +latestversionsh="$(grep -w 'downloadBox' "index.html")" +latestversionsh=$(echo "$latestversionsh" | grep 'linux') + +a="$(grep -w 'data-linux="' "download")" +latestversionsh=${latestversionsh#*'href="'} +latestversionsh=${latestversionsh%'">'*} + +# Download latest golang version +wget "https://go.dev"$latestversionsh + +# Remove any previous Go installation then extract the archive +rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.1.linux-amd64.tar.gz +export PATH=$PATH:/usr/local/go/bin \ No newline at end of file