英文:
manual compiling doozerd fails
问题
我在以下位置安装了doozerd的源代码:
home/stephan/src/go/src/pkg/github.com/ha/doozerd
$GOROOT = /home/stephan/src/go
$GOPATH = /home/stephan/src/go/src/pkg/
当我尝试在从github上检出的doozerd中运行./all.sh时,我遇到了本地找不到包的错误:
.
imports github.com/ha/doozerd/peer
imports github.com/ha/doozerd/web
imports code.google.com/p/go.net/websocket: /home/stephan/src/go/src/pkg/github.com/ha/doozerd/web/web.go:4:2: 本地找不到包
.
imports github.com/ha/doozerd/peer
imports github.com/ha/doozerd/consensus
imports code.google.com/p/goprotobuf/proto: /home/stephan/src/go/src/pkg/github.com/ha/doozerd/server/conn.go:4:2: 本地找不到包
.
imports github.com/ha/doozer: /home/stephan/src/go/src/pkg/github.com/ha/doozerd/peer/peer.go:4:2: 本地找不到包
我以为go会找到缺少的依赖项并自动安装它们。我错过了什么?
英文:
I installed doozerd sources in:
home/stephan/src/go/src/pkg/github.com/ha/doozerd
$GOROOT = /home/stephan/src/go
$GOPATH = /home/stephan/src/go/src/pkg/
When I try to do ./all.sh in the doozerd checkout from github I get package could not be found locally errors.. :
.
imports github.com/ha/doozerd/peer
imports github.com/ha/doozerd/web
imports code.google.com/p/go.net/websocket: /home/stephan/src/go/src/pkg/github.com/ha/doozerd/web/web.go:4:2: package could not be found locally
.
imports github.com/ha/doozerd/peer
imports github.com/ha/doozerd/consensus
imports code.google.com/p/goprotobuf/proto: /home/stephan/src/go/src/pkg/github.com/ha/doozerd/server/conn.go:4:2: package could not be found locally
.
imports github.com/ha/doozer: /home/stephan/src/go/src/pkg/github.com/ha/doozerd/peer/peer.go:4:2: package could not be found locally
I thought go would find the missing requirements, and install them itself.
What am I missing?
答案1
得分: 2
$GOPATH = /home/stephan/src/go/src/pkg/
意味着go工具在/home/stephan/src/go/src/pkg/src/<import-path>
中寻找包,但是你把源代码放在了/home/stephan/src/go/src/pkg/github.com/ha/doozerd
中。
英文:
$GOPATH =
/home/stephan/src/go/src/pkg/
means the go tool looks for packages in
/home/stephan/src/go/src/pkg/src/<import-path>
, but you've put the sources in /home/stephan/src/go/src/pkg/github.com/ha/doozerd
instead.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论