2.6. 下载并安装 Go 项目
您可以从在线资源下载并安装第三方 Go 项目,以进一步在 Go 项目中使用其可执行文件和库。安装后,项目的可执行文件和库会根据 Go 工作区中的目录复制到。其依赖项也被安装。
先决条件
-
Go 工作区。
如需更多信息 ,请参阅设置 Go 工作区。
流程
要下载并安装 Go 项目,请运行:
在 Red Hat Enterprise Linux 8 中:
$ go install <third_party_go_project>
-
将
<third_party_go_project
> 替换为您要下载的项目名称。
-
将
在 Red Hat Enterprise Linux 9 中:
$ go install <third_party_go_project>
-
将
<third_party_go_project
> 替换为您要下载的项目名称。
-
将
如需有关第三方项目的可能值的信息,请运行:
在 Red Hat Enterprise Linux 8 中:
$ go help importpath
在 Red Hat Enterprise Linux 9 中:
$ go help importpath