dotfiles/scripts/go.sh

27 lines
598 B
Bash
Raw Normal View History

2021-07-25 16:13:54 +00:00
#!/bin/bash
2021-07-27 18:59:49 +00:00
VERSION="1.16.6"
2021-07-25 16:13:54 +00:00
2021-07-27 18:59:49 +00:00
function install () {
echo "installing go"
wget https://golang.org/dl/go$VERSION.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go$VERSION.linux-amd64.tar.gz
rm go$VERSION.linux-amd64.tar.gz
2021-07-27 19:12:03 +00:00
sudo rm $HOME/.config/go/env
ln -s $HOME/dotfiles/go/env $HOME/.config/go/env
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