Last active
February 26, 2024 11:45
-
-
Save hermanzdosilovic/9b12c8f4a3535ce21dfe9f1c03c06f91 to your computer and use it in GitHub Desktop.
My script for installing Go.
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 | |
GO_VERSION=1.22.0 # https://go.dev/dl/ | |
system=$(uname | tr '[:upper:]' '[:lower:]') | |
arch | grep -i arm &> /dev/null | |
if [[ $? -eq 0 ]]; then | |
arch=$(arch) | |
if [[ "$arch" == "armv7l" ]]; then | |
arch=armv6l | |
fi | |
else | |
arch=amd64 | |
fi | |
curl -L https://golang.org/dl/go${GO_VERSION}.${system}-${arch}.tar.gz -o ~/go.tar.gz | |
sudo rm -rf /usr/local/go | |
sudo tar -C /usr/local -xzf ~/go.tar.gz | |
rm ~/go.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To install, run:
curl -L https://gist.githubusercontent.com/hermanzdosilovic/9b12c8f4a3535ce21dfe9f1c03c06f91/raw | bash