简体   繁体   English

go 1.13 有 go 工具版本 12.9

[英]go 1.13 has go tools version 12.9

I created the dir TEST-13 under GOPATH/src我在GOPATH/src下创建了目录TEST-13

I installed hello.go and hello_test.go (the specified test code files)我安装了hello.gohello_test.go (指定的测试代码文件)

Is there a reason that in version 1.13 running go mod init produces the following go.mod:是否有原因在版本 1.13 中运行go mod init会产生以下 go.mod:

module TEST-13

go 1.12

Running go tet in the directory gets errors - See example:在目录中运行go tet会出错 - 请参见示例:

compile: version "go1.13" does not match go tool version "go1.12.9"

This message produces 7 similar messages for various library modules此消息为各种库模块生成 7 条类似消息

How do I fix this - or is it a release error?我该如何解决这个问题 - 或者它是一个发布错误? - or did I mess up the install? - 还是我搞砸了安装?

I have solved the problem by removing all traces of previous go installations and reinstalling.我通过删除以前 go 安装并重新安装的所有痕迹解决了这个问题。

Thank you for you answers谢谢你的回答

maybe its me but, after i find versions with:也许是我,但是,在我找到具有以下内容的版本之后:

$ where go

and removed the ones from older versions, this issue emerged并从旧版本中删除了,这个问题就出现了

# vendor/golang.org/x/crypto/internal/subtle
compile: version "go1.13.3" does not match go tool version "go1.14.4"
# vendor/golang.org/x/crypto/curve25519
compile: version "go1.13.3" does not match go tool version "go1.14.4"
# runtime/cgo
compile: version "go1.13.3" does not match go tool version "go1.14.4"

First I removed go again with brew too首先,我也用 brew 再次删除了 go

$ brew uninstall --ignore-dependencies go
  • Then I checked my path in .bashrc and sourced it again anyways.然后我检查了我在.bashrc中的路径并再次获取它。

It didn't solve neither.也没有解决。

  • Finally I restarted my Terminal and it started working.最后我重新启动了我的终端,它开始工作了。

I don't know which ones were required but I can't reproduce the error.我不知道需要哪些,但我无法重现该错误。 You can try all of them.您可以尝试所有这些。 If none works, maybe restart your machine as well如果没有工作,也许也重新启动你的机器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM