Skip to content

Instantly share code, notes, and snippets.

@hermanzdosilovic
Last active February 26, 2024 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hermanzdosilovic/9b12c8f4a3535ce21dfe9f1c03c06f91 to your computer and use it in GitHub Desktop.
Save hermanzdosilovic/9b12c8f4a3535ce21dfe9f1c03c06f91 to your computer and use it in GitHub Desktop.
My script for installing Go.
#!/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
@hermanzdosilovic
Copy link
Author

To install, run:

curl -L https://gist.githubusercontent.com/hermanzdosilovic/9b12c8f4a3535ce21dfe9f1c03c06f91/raw | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment