英文:
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
然后,我尝试修改我的GOROOT。
太可怕了!
我只需要重新下载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
next, I try modify my GOROOT.
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论