无法找到 GOROOT 目录:/usr/local/go

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

Cannot find GOROOT directory: /usr/local/go

问题

我已经将这个放在/go/src/first_webapp/server.go中。

当我运行命令go install first_webapp时,我得到以下错误:

无法找到GOROOT目录:/usr/local/go

英文:
I have put this in / go / src /first_webapp  server.go

And when I run the command go install first webapp I get this error,

cannot find GOROOT directory: /usr/local/go

答案1

得分: 4

请确保您已正确安装了Golang,并按照此处所述设置了环境变量:https://golang.org/doc/install

英文:

Make sure you have installed Golang correctly and set your env variables like it says in here: https://golang.org/doc/install

huangapple
  • 本文由 发表于 2021年10月4日 00:41:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/69426900.html
匿名

发表评论

匿名网友

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

确定