git - Go Get not Working 用于下载 Hyperledger Fabric

标签 git go ibm-cloud blockchain

我正在尝试从 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 文件夹。

这里有一些关于如何使用它以及它是什么的资源:

请记住,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/

相关文章:

git - 无法完成 Git Rebase

json - 一个简单的 json 请求返回一个奇怪的字符串而不是 json 本身

c++ - 通过 TCP 套接字发送大的 Base64 字符串

mongodb - 在 Go 中使用 MongoDb 默认驱动程序创建唯一索引

mysql - MySQL 的环回连接器未关闭

ibm-cloud - 如何删除 IBM Bluemix 中的 "space"?

java - 使用 WebSockets 的 IBM Watson 语音转文本

git - 在 Git 中将一个更改 merge 到多个分支

git - 无法在 git 中复制和粘贴 - macos

git - 使用 git 查找添加的与正则表达式匹配的行