I tried the answer here Removed golang but go command still works?, but it didn\'t work (I can still run go)
Currently, when I run which go
I see this o
For Windows 10:
Apps
in the Settings
App. Go Programming Language *
in the list and uninstall it. C:\Go\bin
from your PATH
environment variable (only if you don't plan on installing another version of golang)You might try
rm -rvf /usr/local/go/
then remove any mention of go
in e.g. your ~/.bashrc
; then you need at least to logout and login.
However, be careful when doing that. You might break your system badly if something is wrong.
PS. I am assuming a Linux or POSIX system.
On a Mac-OS Catalina
need to add sudo before rm -rf /usr/local/go sudo rm -rf /usr/local/go otherwise, we will run into permission denial.
sudo vim ~/.profile or sudo ~/.bash_profile remove export PATH=$PATH:$GOPATH/BIN or anything related to go lang
Hope it helps you :)
Update August 2019
Found the official uninstall docs worked as expected (on Mac OSX).
$ which go
/usr/local/go/bin/go
In summary, to uninstall:
$ sudo rm -rf /usr/local/go
$ sudo rm /etc/paths.d/go
Then, did a fresh install with homebrew using brew install go
. Now, i have:
$ which go
/usr/local/bin/go
In MacOS, you can just do it with brew
:
brew uninstall go
brew install go
brew upgrade go
I'm using Ubuntu. I spent a whole morning fixing this, tried all different solutions, when I type go version, it's still there, really annoying... Finally this worked for me, hope this will help!
sudo apt-get remove golang-go
sudo apt-get remove --auto-remove golang-go