我正在尝试从 IBM Bluemix BlockChain Examples 运行这个示例应用程序: https://console.ng.bluemix.net/docs/services/blockchain/ibmblockchain_tutorials.html#hellocc
我正在运行以下命令: C:\goProjects>去获取 github.com/hyperledger-archives/fabric/tree/v0.5-developer-preview/core/chaincode/shim
我得到的错误如下。
package github.com/hyperledger-archives/fabric/tree/v0.5-developer-preview/core/chaincode/shim: cannot find package "github.com/hyperledger-archives/fabric/tree/v0.5-developer-preview/core/chaincode/shim" in any of:
C:\Go\src\github.com\hyperledger-archives\fabric\tree\v0.5-developer-preview\core\chaincode\shim (from $GOROOT)
C:\goProjects\src\github.com\hyperledger-archives\fabric\tree\v0.5-developer-preview\core\chaincode\shim (from $GOPATH)
请让我知道如何进行。
最佳答案
go get
不允许您提取库的特定分支。
您可以通过以下方式 pull master:
go get -d github.com/hyperledger-archives/fabric/core/chaincode/shim
您正在寻找的可能是使用 vendoring 文件夹。
这里有一些关于如何使用它以及它是什么的资源:
- A post on reddit on how to use Vendoring
- A post on StackOverflow
- A blog post about the
govendor
tool
请记住,vendoring 已作为 Go 1.5 的实验性引入,在 1.6 中被接受,并且在我们撰写本文时在 1.7 中是默认的,因此通常如果您的构建工具在 vendor
文件夹,它将使用那个文件夹(在您的情况下,您可以提取所需代码的特定版本)
您可以手动执行此操作,或使用 package management tools available. 之一
关于git - Go Get not Working 用于下载 Hyperledger Fabric,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40217666/