2021-08-15 15:51:24 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-07-25 16:13:54 +00:00
|
|
|
|
2021-11-24 14:14:39 +00:00
|
|
|
VERSION="1.17.3"
|
2021-07-25 16:13:54 +00:00
|
|
|
|
2021-07-27 18:59:49 +00:00
|
|
|
function install () {
|
|
|
|
echo "installing go"
|
2021-08-17 05:08:52 +00:00
|
|
|
cd ~
|
2021-11-24 14:14:39 +00:00
|
|
|
wget https://golang.org/dl/go${VERSION}.linux-amd64.tar.gz
|
2021-07-27 18:59:49 +00:00
|
|
|
sudo rm -rf /usr/local/go
|
2021-11-24 14:14:39 +00:00
|
|
|
sudo tar -C /usr/local -xzf go${VERSION}.linux-amd64.tar.gz
|
|
|
|
sudo rm go${VERSION}.linux-amd64.tar.gz
|
|
|
|
sudo rm -rf ${HOME}/.config/go
|
|
|
|
sudo mkdir ${HOME}/.config/go
|
|
|
|
sudo ln -s ${DOTFILES_PATH}/go/env ${HOME}/.config/go/env
|
2021-08-17 05:08:52 +00:00
|
|
|
printf "\n\n"
|
|
|
|
go version
|
2021-07-27 18:59:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function uninstall () {
|
|
|
|
echo "uninstalling go"
|
|
|
|
sudo rm -rf /usr/local/go
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$1" == "install" ]; then
|
|
|
|
install
|
|
|
|
elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
|
|
|
|
uninstall
|
|
|
|
else
|
|
|
|
echo "please specify args with install or uninstall"
|
|
|
|
fi
|