hyperledger-fabric - Hyperledger Fabric 1.2.0 开发者链码教程无法获取和构建
问题描述
尝试遵循hyperledger fabric 1.2.0 开发者链码教程。
我无法通过执行
go get -u github.com/hyperledger/fabric/core/chaincode/shim
. 我尝试按照此处的建议hyperledger/fabric
从我的 GOPATHsrc
目录中删除源文件夹,但不断弹出相同的错误消息:
github.com/hyperledger/fabric/vendor/github.com/docker/docker/pkg/archive
../github.com/hyperledger/fabric/vendor/github.com/docker/docker/pkg/archive/archive.go:364:5: hdr.Format undefined (type *tar.Header has no field or method Format)
../github.com/hyperledger/fabric/vendor/github.com/docker/docker/pkg/archive/archive.go:364:15: undefined: tar.FormatPAX
../github.com/hyperledger/fabric/vendor/github.com/docker/docker/pkg/archive/archive.go:1166:7: hdr.Format undefined (type *tar.Header has no field or method Format)
../github.com/hyperledger/fabric/vendor/github.com/docker/docker/pkg/archive/archive.go:1166:17: undefined: tar.FormatPAX
跳过go get
命令并直接进入go build
将输出与上述相同的错误。
我也尝试安装 gnu-tar无济于事。
解决方案
重新安装最新的稳定版 Golang 就可以解决问题。在撰写本文时,go 的稳定版本是 1.10.3。
该问题是由 golang 版本 1.9.3 具有未定义的结构引起的,tar.FormatPAX
其中一个超级账本结构 go 源文件需要该结构。
推荐阅读
- html - 是否有一个什么都不做的 HTML 标签,所以我可以将它用作标志?
- intellij-idea - 无法在 Intellij 中删除 UML 图
- python - 将 groupby 对象与另一个数据框合并
- android - react native android firebase sign in with apple [错误:提供的身份验证凭据格式错误,已过期或当前不受支持。]
- qt - 以编程方式设置时,Tristate QCheckBox 不会重新绘制自身的问题
- python - 为什么这段代码会进入无限的while循环?
- javascript - 在 Next.JS 应用程序中,Apollo 查询是从浏览器还是服务器运行?
- c++ - 通过成员初始化列表初始化类的引用变量时出现问题
- java - PDF Box 和 java 版本的兼容性
- prometheus - 如何使用 Prometheus 处理 STATE