小编典典

Golang安装

go

我只是按照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

为什么它要求我再次安装它?


阅读 382

收藏
2020-07-02

共1个答案

小编典典

二进制文件的位置go不在您的路径中。Ubuntu找不到它,建议安装它。将此行添加到您的文件中/etc/profile,或者更好$HOME/.profile

export PATH=$PATH:/usr/local/go/bin

在文档中对此进行了记录:https :
//golang.org/doc/install#install

如果要在编辑任何文件之前尝试此解决方案,则只需执行上述命令并尝试go在Shell中执行该命令即可。

2020-07-02