手动编译doozerd失败。

huangapple go评论79阅读模式
英文:

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/&lt;import-path&gt;, but you've put the sources in /home/stephan/src/go/src/pkg/github.com/ha/doozerd instead.

huangapple
  • 本文由 发表于 2012年2月20日 19:46:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/9360618.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定