Skip to content

Instantly share code, notes, and snippets.

@nullbio
Last active September 13, 2016 04:41
Show Gist options
  • Select an option

  • Save nullbio/0d59762b5c521d9fe79b7c490a1f48b8 to your computer and use it in GitHub Desktop.

Select an option

Save nullbio/0d59762b5c521d9fe79b7c490a1f48b8 to your computer and use it in GitHub Desktop.
function install-go --argument v
if test -z $v
echo "Must supply a version"
return 1
end
if not wget https://storage.googleapis.com/golang/go{$v}.linux-amd64.tar.gz
echo "Failed to download"
return 1
end
echo "Cleaning GOPATH:"
for i in $GOPATH
echo "D" $i/pkg
rm -rf $i/pkg
end
echo "Uninstalling previous Go"
sudo rm -rf /usr/local/go
echo "Installing Go" $v
sudo tar -C /usr/local -xzf go{$v}.linux-amd64.tar.gz
echo "Updating go-code"
go get -u github.com/nsf/gocode
gocode close
gocode drop-cache
echo "Cleaning up"
rm go{$v}.linux-amd64.tar.gz
curl http://foaas.com/madison/fish/pat -H "Accept: text/plain"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment