Skip to content

Instantly share code, notes, and snippets.

View anafvana's full-sized avatar

Ana anafvana

  • Norway
View GitHub Profile
@anafvana
anafvana / go.sh
Last active March 6, 2022 20:39
Auto installer/updater for Golang (Linux AMD64 only)
url=https://go.dev
#get source code of download page
echo "Starting Go installation"
curl -o $HOME/temp.txt $url/dl/
#retrieve the first link for linux amd64 (recommended download)
grepmatch=$( cat $HOME/temp.txt | grep -E '\/dl\/.*linux.*amd64.tar.gz' | head -1)
echo $( echo $grepmatch | sed 's/^.*\(\/dl\/.*tar\.gz\).*$/\1/') > $HOME/temp.txt