0

I'm running Mac OSX Yosemite.

I'm trying update from golang 1.4 to golang 1.6. I uninstalled golang but I noticed I could still run the go command go version = go1.4.2 darwin/amd64. Why is this so?

The directions aren't super clear IMO. They say

  1. To remove an existing Go installation This is usually /usr/local/go (done) Remove etc/paths.d/go
  2. I edited the bash by running go version go1.4.2 darwin/amd64
Chris W
  • 785
  • 8
  • 18
  • 4
    please, run command `which go`. It will print location of `go` binary – RoninDev Feb 26 '16 at 05:22
  • It prints ```usr/local/bin/go``` but when I go to ```usr/local/bin/``` there is no go directory. So how is the ```go``` command still running? – Chris W Feb 26 '16 at 05:27
  • I guess i had to look at it through terminal – Chris W Feb 26 '16 at 05:30
  • 1
    I can only recommend you use [GVM](https://github.com/moovweb/gvm) to help you avoid these problems in the future. – s7anley Feb 26 '16 at 05:53
  • Maybe you still have binary in `/usr/local/bin` directory named `go`? – s7anley Feb 26 '16 at 05:56
  • 1
    when you run 'which xxx' it tells you where the executable xxx lives, so if it said /usr/local/bin/go, it means (as @s7anley said) you have the binary go in /usr/local/bin. Did you install it via homebrew (which puts stuff there by default)? if so, homebrew will upgrade it next time you to an update / upgrade – David Budworth Feb 26 '16 at 16:11

3 Answers3

5

I was running into the same issue. I ended up with this solution:

cd /usr/local/bin
rm go

Removes the 'go' command

Then go back to golang.org and re-download the newest version, run the installer and when you run the 'go' command it will display 1.12.9 (As of writing this post).

2

You can try this

sudo apt-get remove golang-go

Then do this

sudo apt-get remove --auto-remove golang-go
Anshu
  • 1,277
  • 2
  • 13
  • 28
1

I ran source ~/.bash_profile and that updated the env variables.

Chris W
  • 785
  • 8
  • 18