当我运行go build(with dep)时,fabric-sdk-go出了点问题

问题描述 投票:0回答:1

当我运行go build并出现以下错误:

vendor/github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util/csp.go:47:8: cannot convert nil to type csr.KeyRequest
vendor/github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util/csp.go:132:37: cannot use req.KeyRequest (type *csr.KeyRequest) as type csr.KeyRequest in argument to getBCCSPKeyOpts

我使用dep进行软件包管理,这是我的Gopkg.toml:

[[constraint]]
  # Release v1.0.0-alpha4
  name = "github.com/hyperledger/fabric-sdk-go"
  revision = "a906355f73d060d7bf95874a9e90dc17589edbb3"
hyperledger-fabric hyperledger-fabric-sdk-go
1个回答
0
投票

您需要为一些依赖项添加一些[[override]]子句,这些依赖项在当前版本中不起作用,但是在创建库时起作用。

或者,使用go模块,因为最新版本启用了模块。

这是cfssl版本的特别要求。

以dep形式,这是:

[[override]]
  revision = "4e2dcbde500472449917533851bf4bae9bdff562"
  name = "github.com/cloudflare/cfssl"

以模块形式,这是:github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004

© www.soinside.com 2019 - 2024. All rights reserved.