ide在$ GOPATH中找不到包shim和proto包

问题描述 投票:0回答:2

我一直在设置一个小型Hyperledger Fabric应用程序。它已经在运行,我可以添加删除和更改用户。

但是直到现在,我一直在使用nano进行编码。

为了自动补全,我想更改为适当的想法(goland)。

问题是:在我的本地计算机上找不到软件包

"github.com/hyperledger/fabric/core/chaincode/shim"
"github.com/hyperledger/fabric/protos/peer"

gopath设置正确,但是两个软件包不在文件夹中。也就是说,本地的go构建也不起作用。

尽管软件包在CLI上存在。

如何安装依赖项,以便它们也可以在本地计算机上安装?这是否是我们所希望的?如果是,为什么呢?

ps:我已经尝试过go get -u github.com/hyperledger/fabric/core/chaincode/shim产生的错误是:

package github.com/hyperledger/fabric/core/chaincode/shim: cannot find package "github.com/hyperledger/fabric/core/chaincode/shim" in any of: /usr/local/go/src/github.com/hyperledger/fabric/core/chaincode/shim (from $GOROOT) /home/funuser/go/src/github.com/hyperledger/fabric/core/chaincode/shim (from $GOPATH)

go hyperledger-fabric hyperledger goland
2个回答
0
投票

[不幸的是,go get仅导入go代码文件。其他资产(如原始原型文件)不包括在内。一个选项是在$GOPATH/src/github.com/hyperledger/fabric

中检出git repo

0
投票

问题是,几个月前,垫片和原型已移至独立存储库,您需要在go getgithub.com/hyperledger/fabric-chaincode-go/shim上执行github.com/hypereledger/fabric-protos-go并将您的导入引用更改为这些新存储库

© www.soinside.com 2019 - 2024. All rights reserved.