英文:
golang - "not a package file" after "go get -u" from github
问题
我正在尝试使用以下命令安装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:
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"
是什么导致了这些问题?谢谢。
英文:
I am tryng to install govendor
using the command
go get -u github.com/kardianos/govendor
but everytime I get the following
# 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
I am using golang version 1.9 linux/amd64 with the following 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"
What is causing these issues?
Thank you
答案1
得分: 1
我已经解决了清理$GOPATH/pkg
文件夹的问题,并重新执行了以下命令:
go get -u github.com/kardianos/govendor
英文:
I have solved cleaning my $GOPATH/pkg
folder and then re-executing:
go get -u github.com/kardianos/govendor
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论