Details
-
Bug
-
Status: Unverified
-
Medium
-
Resolution: Unresolved
-
v1.0.0
-
None
-
None
-
(Please add steps to reproduce)
Description
A project using fabric-sdk-go, it output errors when build it.
➜ fabric-sdk-go-sample git:(master) ✗ go build main.go # github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util ../../../../go/pkg/mod/github.com/hyperledger/fabric-sdk-go@v1.0.0-alpha5.0.20190411180201-5a9a0e749e4f/internal/github.com/hyperledger/fabric-ca/util/csp.go:47:8: cannot convert nil to type csr.KeyRequest
Comparing nil with a struct leads to this error. The code in fabric-sdk-go and fabric-ca is the same in every release version:
https://github.com/hyperledger/fabric-ca/blob/v2.0.0-alpha/util/csp.go#L119
func getBCCSPKeyOpts(kr csr.KeyRequest, ephemeral bool) (opts core.KeyGenOpts, err error) { if kr == nil { return factory.GetECDSAKeyGenOpts(ephemeral), nil }
So, is it a bug to fix it?