简体   繁体   中英

Golang `go get` - Cannot find package in any of

I've followed this guide to install Go on Ubuntu 16.04. However, when I follow the installation instructions for a Go application ( go get github.com/src-d/enry/cmd/enry ), I get the following error:

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)

Here's the output of 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"

What am I doing wrong?

Note: I have absolutely zero knowledge of how to program in Go, I'm just trying to install a CLI application.

Check the writable right of $GOPATH. As you setting, it at /root

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM