Golang `go get` - 找不到任何包

标签 go installation failed-installation

我关注了this guide在 Ubuntu 16.04 上安装 Go。但是,当我按照 installation instructions对于 Go 应用程序 (go get github.com/src-d/enry/cmd/enry),我收到以下错误:

package github.com/src-d/enry/v2: cannot find package "github.com/src-d/enry/v2" in any of:
        /usr/local/go/src/github.com/src-d/enry/v2 (from $GOROOT)
        /root/work/src/github.com/src-d/enry/v2 (from $GOPATH)
package github.com/src-d/enry/v2/data: cannot find package "github.com/src-d/enry/v2/data" in any of:
        /usr/local/go/src/github.com/src-d/enry/v2/data (from $GOROOT)
        /root/work/src/github.com/src-d/enry/v2/data (from $GOPATH)

这是 go env 的输出:

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/work"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

我做错了什么?

注意:我对如何使用 Go 进行编程完全是零知识,我只是想安装一个 CLI 应用程序。

最佳答案

检查$GOPATH的可写权限。当你设置时,它在/root

关于Golang `go get` - 找不到任何包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56534343/

相关文章:

python - 在python中手动安装nltk训练数据

java - Install4j 自动更新 - 使用更新计划注册表

r - 在 R 中安装插入符号但无法在库中使用

debugging - 在 Delve 中调试时理解 `time.Time` 值

http - 将 HTTP JSON 正文响应转换为 Go 中的映射

json - 使用 simplejson 转 JSON

c# - 如何在安装项目中使用 IlMerge?

go - 使用 Go 中的 DELETE 端点

ubuntu - 错误 : Library "libGL" was not found

node.js - 安装reactjs时出错: Error unexpected end of JSON input while parsing near