Golang安装
我只是按照golang(ubuntu 16)的安装指南进行操作。我在/ etc /
usr中解压缩了档案,在/home/user/.profile中添加了env变量,我刚刚测试了基于hello world代码的基本go构建。
我收到以下错误:
The program 'go' is currently not installed. You can install it by typing: sudo apt install golang-go
为什么它要求我再次安装它?
回答:
二进制文件的位置go
不在您的路径中。Ubuntu找不到它,建议安装它。将此行添加到您的文件中/etc/profile
,或者更好$HOME/.profile
:
export PATH=$PATH:/usr/local/go/bin
在文档中对此进行了记录:https :
//golang.org/doc/install#install
如果要在编辑任何文件之前尝试此解决方案,则只需执行上述命令并尝试go
在Shell中执行该命令即可。
以上是 Golang安装 的全部内容, 来源链接: utcz.com/qa/399884.html