在版本升级到1.8后,go version命令显示旧版本号 [英] go version command shows old version number after update to 1.8
问题描述
$ go版本
go版本go1.7.5达尔文/ amd64
我的.bashrc看起来像下面那样
#某些出口省略
NPM_PACKAGES = / Users /< me> /。npm-packages
NODE_PATH =$ NPM_PACKAGES / lib / node_modules:$ NODE_PATH
export PATH =〜/ Library / Python / 3.4 / bin:$ PATH
$ b $ export GOPATH = $ HOME / Go
export PATH = $ PATH:/ usr / local / go / bin
我的工作区位于名为Go 在我的家庭文件夹中。
我到目前为止检查过的内容: 检查了/ usr / local / go / bin中的文件,并且VERSION文件状态为1.8,所以我知道安装成功了。 这不是版本号本身的错误,因为我不能使用NextResultSet()sql功能在1.8版本中,我相信罪魁祸首可能是上述.bashrc文件中的错误配置,因为只有终端被困在旧版本中,但我无法弄清楚它有什么问题。 Go的版本安装,否则你看不到 IDE可能具有更高级的检测Go安装的方法,其他只是扫描 执行 这意味着如果 Pretty much the title. I downloaded/installed Go 1.8 for OS X, but when I go My .bashrc look like the following My workspace is in a directory called "Go" in my home folder. What I have checked so far: I've checked the files in /usr/local/go/bin, and the VERSION file states "1.8", so I know the installation was successful. I have also renewed my terminal session, I even rebooted my pc to make sure no other processes were interfering with it. I use Webstorm as my IDE, and it correctly recognized 1.8 as the working version It's not a bug in the version number itself, as I can't use the "NextResultSet()" sql functionality, introduced in version 1.8 I believe the culprit might be a wrong configuration in the .bashrc file above, as only the terminal is stuck on the old version, but I can't figure out what is wrong with it. You obviously have an old version of Go installed, else you couldn't see IDEs might have more advanced method of detecting Go installations other that simply scanning Execute Note that in your Which means if 这篇关于在版本升级到1.8后,go version命令显示旧版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
go版本go1.7.5 darwin / amd64
作为输出 go版本
。
PATH
和 GOROOT
(这就是您的IDE找到并建议更新的Go 1.8)的原因。
,它会转到
,然后您会看到旧的Go所在的位置。注意,在你的 .bashrc
中,你会附加适当的Go(删除它)(以及对它的引用)。
bin
文件夹添加到 PATH end :
export PATH = $ PATH:/ usr / local / go / bin
PATH
包含旧版Go安装的 bin
文件夹(很可能),用于执行 go
命令。$ go version
go version go1.7.5 darwin/amd64
# 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
go version go1.7.5 darwin/amd64
as the output of go version
.PATH
and GOROOT
(and that's why your IDE found and suggested the newer Go 1.8).which go
, and you'll see where your old Go resides. Remove it (and references to it)..bashrc
you're appending the proper Go bin
folder to the end of PATH
:export PATH=$PATH:/usr/local/go/bin
PATH
contains the bin
folder of the old Go installation (very likely), that is used to execute the go
command.