Last active
January 25, 2021 20:47
-
-
Save duccas/c9319f56e09603c2a3aefae80ae98994 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
VERSION=$1 | |
if [ "$VERSION" == "" ]; then | |
VERSION="1.15.6" | |
fi | |
sudo apt-get remove golang-go -y \ | |
&& rm -rf /usr/local/go \ | |
&& rm -rf $HOME/go \ | |
&& wget https://golang.org/dl/go$VERSION.linux-amd64.tar.gz \ | |
&& tar -C /usr/local -xzf go$VERSION.linux-amd64.tar.gz \ | |
&& echo 'export PATH=$PATH:/usr/local/go/bin:$PATH:$GOPATH/bin' >> $HOME/.bashrc \ | |
&& echo 'export GOPATH=~/go' >> $HOME/.bashrc \ | |
&& echo 'export GOBIN=$GOPATH/bin' >> $HOME/.bashrc \ | |
&& source ~/.bashrc | |
echo "--------GOLANG VERSION $VERSION INSTALLED--------" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment