I used `go install golang.org/dl/go1.19@latest` , next my GOROOT has been modify , and I can't modify it

huangapple go评论86阅读模式
英文:

I used `go install golang.org/dl/go1.19@latest` , next my GOROOT has been modify , and I can't modify it

问题

升级我的Go环境

go install golang.org/dl/go1.19@latest

接下来,运行 go run main.go

I used `go install golang.org/dl/go1.19@latest` , next my GOROOT has been modify , and I can't modify it

然后,我尝试修改我的GOROOT。

I used `go install golang.org/dl/go1.19@latest` , next my GOROOT has been modify , and I can't modify it

太可怕了!

我只需要重新下载Golang,然后重新安装goimport和gopls等工具。

当我升级Go环境时,我应该重新安装go tools,这让我感到头疼!

而且VS Code需要使用go install go@version

英文:

upgrade my go environment

go install golang.org/dl/go1.19@latest

next , run go run main.go

I used `go install golang.org/dl/go1.19@latest` , next my GOROOT has been modify , and I can't modify it

next, I try modify my GOROOT.

I used `go install golang.org/dl/go1.19@latest` , next my GOROOT has been modify , and I can't modify it

so, terrible!

I only download again golang. next, goimport,gopls some tools install again

I should reinstall go tools when I upgrade go environment, I feel headache!

And VS Code need used the go install go@version.

答案1

得分: 2

这些说明 提到:

> $ go install golang.org/dl/go1.19@latest
> $ go1.19 download
>
> 然后将 go1.19 命令用作您正常的 go 命令。

这意味着 go 仍然指的是您正常的旧版 Go(1.18)。

您应该使用 go1.19 来测试您刚刚安装的内容。


话虽如此,正如评论中所提到的,如果您的目标只是升级 Go,请使用常规安装程序更为可取。

英文:

The instructions mention:

> $ go install golang.org/dl/go1.19@latest
> $ go1.19 download
>
> And then use the go1.19 command as if it were your normal go command.

That means go still refer to your normal legacy Go (1.18)

You should use go1.19 to test what you just installed.


That being said, as commented, if you goal is to just upgrade Go, using the regular installer is preferable.

huangapple
  • 本文由 发表于 2022年12月13日 15:45:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/74781489.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定