The go version command shows the old version number after upgrading to 1.8

Pretty much the name. I downloaded / installed Go 1.8 for OS X, but when I go

$ go version
go version go1.7.5 darwin/amd64

My .bashrc is as follows

# some exports omitted

NPM_PACKAGES=/Users/<me>/.npm-packages
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"

export PATH=~/Library/Python/3.4/bin:$PATH

export GOPATH=$HOME/Go
export PATH=$PATH:/usr/local/go/bin

My workspace is located in the "Go" directory in my home folder.

What I checked so far:

  • I checked the files in / usr / local / go / bin and the VERSION file is "1.8", so I know that the installation was successful.

  • I also updated the terminal session, I even rebooted my computer so that other processes would not interfere with it.

  • I use Webstorm as my IDE and it correctly recognized 1.8 as the working version

  • This is not an error in the version number itself, since I cannot use the "NextResultSet ()" functionality introduced in version 1.8

, .bashrc , , , .

+15
4

, , ​​ Go, go version go1.7.5 darwin/amd64 go version.

IDE Go , PATH GOROOT ( IDE Go 1.8).

which go, , Go. ( ).

, .bashrc Go bin PATH:

export PATH=$PATH:/usr/local/go/bin

, PATH bin Go ( ), go.

+17

. golang 1.10 Mac - golang, Mac 1.7.

golang homebrew .

brew update
brew upgrade golang
+7

TL;DR , /usr/bin/go


:

  1. :

    $which go
    /usr/bin/go
    
  2. :

    ln -s /usr/local/go/bin/go go
    ln -s /usr/local/go/bin/godoc godoc
    ln -s /usr/local/go/bin/gofmt gofmt
    
  3. 3 /usr/bin

+1

.

cp /usr/local/go/bin/* /usr/local/bin/
0

Source: https://habr.com/ru/post/1015935/


All Articles