Created
July 27, 2021 16:11
-
-
Save Zate/6d75f95bd389729c0b35838ec1b80e1c to your computer and use it in GitHub Desktop.
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
get_go() { | |
sudo rm -rf /usr/local/go | |
wget -qO- --show-progress --continue $(wget -qO- https://golang.org/dl/ | grep -oP 'https:\/\/dl\.google\.com\/go\/go([0-9\.]+)\.linux-amd64\.tar\.gz' | head -n 1) | sudo tar zxf - -C /usr/local | |
echo "Create the skeleton for your local users go directory" | |
mkdir -p ~/go/{bin,pkg,src} | |
echo "Setting up GOPATH" | |
echo "export GOPATH=~/go" >> ~/.profile && source ~/.profile | |
echo "Setting PATH to include golang binaries" | |
echo "export PATH='$PATH':/usr/local/go/bin:$GOPATH/bin" >> ~/.profile | |
source ~/.profile | |
go version | |
} | |
get_go |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment