2017-09-23 258 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上,或者选择另一个软件包来使用。

相关问题