链代码示例中没有可构建的 Go 源文件错误

no buildable Go source files error in Chain Code Examples

我刚开始学习 GO 和 ChainCode。我已经按照以下URL中提到的说明学习编程链码

https://github.com/IBM-Blockchain/learn-chaincode

我已经设置了代码和 运行 命令 $ go build ./

但我收到以下错误

../../../hyperledger/fabric/core/crypto/attributes/attributes.go:28:2: no buildable Go source files in /home/serveradmin/gowork/src/github.com/hyperledger/fabric/core/crypto/attributes/proto

如果有人遇到这个错误并修复了它,请告诉我

您 运行 go build 来自错误的目录。您在 $GOPATH/src/github.com/hyperledger/fabric/core/crypto/attributes/proto,但您应该在 $GOPATH/src/github.com/<yourgithubid>/learn-chaincode/start。查看 the instructions

@Dinesh,您需要 make protos 才能在该文件夹中创建文件 (core/crypto/attributes/proto)

其实是更新后的bug,已经修复了。 根据以下内容, https://github.com/hyperledger/fabric/commit/af5f75d3fb52ee5cd607abfef4324fc049153268

Revert "Upgrade go protobuff from 3-beta to 3" This reverts commit a98c59a.

We are experiencing several failures related to this merge, so lets revert it for now and re-group

请拉取最新版本,会顺利运行