On Linux, we can do this to remove Go completely:
rm -rf "/usr/local/.go/" rm -rf "/usr/local/go/"
These two commands remove go and hidden .go files. Now we also need to update the entries in the shell profile.
Open your main file. Basically, I open as sudo gedit ~/.bashrc and sudo gedit ~/.bashrc all mentions of transitions.
You can also do this with the sed command in Ubuntu.
sed -i '/# GoLang/d' .bashrc sed -i '/export GOROOT/d' .bashrc sed -i '/:$GOROOT/d' .bashrc sed -i '/export GOPATH/d' .bashrc sed -i '/:$GOPATH/d' .bashrc
This will remove the Golang from anywhere. Also run this after executing these commands
source ~/.bash_profile
Tested on Linux 18.04 as well. All this.
amku91
source share