golang - 来自github的{go get -u'之后的“不是包文件”

时间:2017-09-04 10:40:51

标签: go govendor

我正在尝试使用命令
安装govendor go get -u github.com/kardianos/govendor

但每次我得到以下

# github.com/kardianos/govendor/cliprompt
go/src/github.com/kardianos/govendor/cliprompt/cliPrompt.go:13:2: import /home/pelli/go/pkg/linux_amd64/github.com/kardianos/govendor/prompt.a: not a package file

# github.com/kardianos/govendor/context
go/src/github.com/kardianos/govendor/context/context.go:18:2: import /home/pelli/go/pkg/linux_amd64/github.com/kardianos/govendor/internal/pathos.a: not a package file

我正在使用golang版本1.9 linux / amd64以及以下env:

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/pelli/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build215462614=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

导致这些问题的原因是什么? 谢谢

1 个答案:

答案 0 :(得分:1)

我已解决清理我的$GOPATH/pkg文件夹然后重新执行的问题:
go get -u github.com/kardianos/govendor