2017-09-23 261 views
-2

我試圖解決Orielly提供的示例Decentrallized Applications中提供的示例。golang錯誤:運行時無法找到軟件包獲取

go-ipfs包似乎已過時,新版本無法正常工作。所以我手動應付舊版本並嘗試編譯go-kerala。

雖然部分文件夾存在於路徑中,但出現錯誤。

例如, /home/rajkumar/go/src/github.com/ipfs/go- ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58 (from $GOPATH)在我手動複製舊版本文件後仍存在,但仍然執行get-get命令會給出錯誤。

$go get -d github.com/llSourcell/kerala 
package code.google.com/p/go.net/context: unrecognized import path 
"code.google.com/p/go.net/context" (parse 
https://code.google.com/p/go.net/context?go-get=1: no go-import meta 
tags (meta tag github.com/golang/go did not match import path 
code.google.com/p/go.net/context)) 
package github.com/ipfs/go- 
ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58: cannot find 
package "github.com/ipfs/go- 
ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58" in any of: 
    /usr/local/go/src/github.com/ipfs/go- 
ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58 (from $GOROOT) 
    /home/rajkumar/go/src/github.com/ipfs/go- 
ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58 (from $GOPATH) 
package github.com/ipfs/go- 
ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup: cannot find 
package "github.com/ipfs/go- 
ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup" in any of: 
    /usr/local/go/src/github.com/ipfs/go- 
ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup (from $GOROOT) 
/home/rajkumar/go/src/github.com/ipfs/go- 
    ipfs/Godeps/_workspace/src/github.com/jbenet/go-ctxgroup (from $GOPATH) 
package github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore: cannot find 
package "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore" in any of: 
    /usr/local/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore (from $GOROOT) 
    /home/rajkumar/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore (from $GOPATH) 
package github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync: cannot find package "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync" in any of: 
    /usr/local/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync (from $GOROOT) 
    /home/rajkumar/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync (from $GOPATH) 

是否有任何步驟我錯過了解決錯誤。

回答

2

你已經複製了過時的代碼,它不會被編譯。

code.google.com/p/go.net/context

code.google.com已經關閉了,這是一個不能再被使用了舊的導入路徑。該錯誤告訴你出了什麼問題,該路徑不能被導入,因爲它不存在(請嘗試在瀏覽器中訪問它)。

您可以嘗試花費大量的時間修復舊的導入,只是發現軟件包已經改變,不會再編譯,所以我建議從最新版本開始,聯繫github的作者.com/ipfs/go-ipfs在github上,或者選擇另一個軟件包來使用。

相關問題