尝试遵循hyperledger fabric 1.2.0 developers chaincode tutorial。
我无法通过执行获取超级账本结构的依赖关系
go get -u github.com/hyperledger/fabric/core/chaincode/shim
。我尝试从GOPATH的hyperledger/fabric
目录中将src
源文件夹删除为suggested here,但是仍然弹出相同的错误消息:
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
将输出与上述相同的错误。
我也尝试installing gnu-tar无济于事。
答案 0 :(得分:2)
重新安装最新的Golang稳定版本可以解决问题。在撰写本文时,stable version of go为1.10.3。
此问题是由golang版本1.9.3引起的,该版本具有tar.FormatPAX
的未定义结构,这是超级账本结构go源文件之一所需要的。