2016-09-12 70 views
0

我有我試圖vendorize包。它使用capnproto2軟件包。它建立沒有錯誤時,包是在$ GOPATH/src目錄/ zombiezen.com /去/ capnproto2但是當我移動到我的供應商目錄失敗。我的項目位於我的GOPATH下。go1.7不reconizing供應商目錄

$ go build 
../fram/rim/fsd.go:7:8: cannot find package "zombiezen.com/go/capnproto2" in any of: 
    /home/mjohn/software/go/src/zombiezen.com/go/capnproto2 (from $GOROOT) 
    /home/mjohn/workspace/gopath/src/zombiezen.com/go/capnproto2 (from $GOPATH) 
../fram/rim/schema.capnp.go:7:2: cannot find package "zombiezen.com/go/capnproto2/encoding/text" in any of: 
    /home/mjohn/software/go/src/zombiezen.com/go/capnproto2/encoding/text (from $GOROOT) 
    /home/mjohn/workspace/gopath/src/zombiezen.com/go/capnproto2/encoding/text (from $GOPATH) 
../fram/rim/schema.capnp.go:8:2: cannot find package "zombiezen.com/go/capnproto2/schemas" in any of: 
    /home/mjohn/software/go/src/zombiezen.com/go/capnproto2/schemas (from $GOROOT) 
    /home/mjohn/workspace/gopath/src/zombiezen.com/go/capnproto2/schemas (from $GOPATH) 

我的環境:

$ go env 
GOARCH="amd64" 
GOBIN="" 
GOEXE="" 
GOHOSTARCH="amd64" 
GOHOSTOS="linux" 
GOOS="linux" 
GOPATH="/home/mjohn/workspace/gopath" 
GORACE="" 
GOROOT="/home/mjohn/software/go" 
GOTOOLDIR="/home/mjohn/software/go/pkg/tool/linux_amd64" 
CC="gcc" 
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build069056451=/tmp/go-build -gno-record-gcc-switches" 
CXX="g++" 
CGO_ENABLED="1" 

我的項目佈局

$ pwd 
/home/mjohn/workspace/gopath/src/mjohn/msg 

$ ls 
cmd/main.go 
cmd/rpc.go 
vendor/zombiezen.com/go/capnproto2 

顯然還有更多的capnproto2目錄,但這是從$副本GOPATH/src目錄/ zombiezen.com /去/ capnproto2。

爲什麼走,不認識我的供應商目錄中的任何想法?

謝謝。

+0

是否有在'/家庭/ mjohn /工作區/ GOPATH/src目錄/ mjohn /郵件/供應商/ zombiezen.com /去/ capnproto2'路徑上的任何符號鏈接目錄? – JimB

+0

是的,msg目錄是一個符號鏈接。我刪除它,並再次嘗試,但仍然看到同樣的問題。 – dangeroushobo

回答

2

mjohn/fram/rim是未能導入zombiezen.com/go/capnproto2,但供應商目錄位於mjohn/msg包中。

您可以廠商mjohn/fram/rim在它的全部,包括mjohn/msg封裝內部的依賴關係,或者您也可以在mjohn/fram/rim包在那裏的進口廠商zombiezen.com/go/capnproto2