簡體   English   中英

Golang`go get`-在以下任何位置均找不到軟件包

[英]Golang `go get` - Cannot find package in any of

我已按照本指南在Ubuntu 16.04上安裝Go。 但是,當我按照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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM