我遵循this guide在Ubuntu 16.04上安装Go。但是,当我针对Go应用程序(go get github.com/src-d/enry/cmd/enry)遵循installation instructions时,出现以下错误:

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

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

10-16 18:14