-
-
Save crgimenes/733e498fa4e3556a0ac538e71ba2fbbe to your computer and use it in GitHub Desktop.
update-golang.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Update Golang (Linux/Mac) | |
go version | |
## Get Last Stable Version | |
LAST_VERSION=$(curl -s 'https://go.dev/VERSION?m=text'|head -n1) | |
os="linux" | |
if [ "$(uname -s)" = "Darwin" ]; then | |
os="darwin" | |
fi | |
arch="amd64" | |
if [ "$(uname -m)" = "arm64" ]; then | |
arch="arm64" | |
fi | |
curl -sO --progress-bar "https://go.dev/dl/${LAST_VERSION}.$os-$arch.tar.gz" | |
rm -rf /usr/local/go | |
tar -C /usr/local -xzf go*.$os-$arch.tar.gz | |
rm -f go*.$os-$arch.tar.gz | |
go versionb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment