install latest version of go

This commit is contained in:
Ryan Bakkes 2022-09-26 16:00:50 +02:00
parent 39aaad5394
commit 50f0314b6e

17
src/applications/golang.sh Executable file
View File

@ -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