How to uninstall Golang?

后端 未结 13 1612
猫巷女王i
猫巷女王i 2020-12-29 00:55

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

13条回答
  •  孤独总比滥情好
    2020-12-29 01:38

    On a Mac-OS system

    1. If you have used an installer, you can uninstall golang by using the same installer.
    2. If you have installed from source
      rm -rf /usr/local/go
      rm -rf $(echo $GOPATH)
      

    Then, remove all entries related to go i.e. GOROOT, GOPATH from ~/.bash_profile and run

    source ~/.bash_profile
    

    On a Linux system

    rm -rf /usr/local/go
    rm -rf $(echo $GOPATH)
    

    Then, remove all entries related to go i.e. GOROOT, GOPATH from ~/.bashrc and run

    source ~/.bashrc
    

提交回复
热议问题