老师,我在通过postman query user时发出这样的错误日志
runtime error: invalid memory address or nil pointer dereference
/usr/lib/go-1.10/src/runtime/panic.go:502 (0x42ad08)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/lib/go-1.10/src/runtime/panic.go:63 (0x429d7d)
panicmem: panic(memoryError)
/usr/lib/go-1.10/src/runtime/signal_unix.go:388 (0x43fc69)
sigpanic: panicmem()
/mnt/e/codes/GitHub/Hyperledger/src/github.com/hyperledger/fabric-sdk-go/pkg/fabsdk/context.go:53 (0xb8c397)
(*FabricSDK).newIdentity: orgName: sdk.provider.IdentityConfig().Client().Organization,
/mnt/e/codes/GitHub/Hyperledger/src/github.com/hyperledger/fabric-sdk-go/pkg/fabsdk/fabsdk.go:313 (0xb8f78d)
(*FabricSDK).Context.func1: identity, err := sdk.newIdentity(options...)
/mnt/e/codes/GitHub/Hyperledger/src/github.com/hyperledger/fabric-sdk-go/pkg/context/context.go:247 (0x9eb7bb)
NewChannel: client, err := clientProvider()
/mnt/e/codes/GitHub/Hyperledger/src/github.com/hyperledger/fabric-sdk-go/pkg/fabsdk/fabsdk.go:330 (0xb8f95c)
(*FabricSDK).ChannelContext.func1: return context.NewChannel(clientCtxProvider, channelID)
/mnt/e/codes/GitHub/Hyperledger/src/github.com/hyperledger/fabric-sdk-go/pkg/client/channel/chclient.go:51 (0xa8ccee)
New: channelContext, err := channelProvider()
/e/codes/GitHub/Hyperledger/src/github.com/hyperledger/fabric/imocc/application/main.go:368 (0xb95c1d)
channelQuery: cli, err := channel.New(ctx)
/e/codes/GitHub/Hyperledger/src/github.com/hyperledger/fabric/imocc/application/main.go:73 (0xb939b4)
queryUser: resp, err := channelQuery("queryUser", [][]byte{
/mnt/e/codes/GitHub/Hyperledger/src/github.com/gin-gonic/gin/context.go:108 (0x932782)
(*Context).Next: c.handlers[c.index](c)
/mnt/e/codes/GitHub/Hyperledger/src/github.com/gin-gonic/gin/recovery.go:48 (0x9436c9)
RecoveryWithWriter.func1: c.Next()
/mnt/e/codes/GitHub/Hyperledger/src/github.com/gin-gonic/gin/context.go:108 (0x932782)
(*Context).Next: c.handlers[c.index](c)
/mnt/e/codes/GitHub/Hyperledger/src/github.com/gin-gonic/gin/logger.go:84 (0x94297b)
LoggerWithWriter.func1: c.Next()
/mnt/e/codes/GitHub/Hyperledger/src/github.com/gin-gonic/gin/context.go:108 (0x932782)
(*Context).Next: c.handlers[c.index](c)
/mnt/e/codes/GitHub/Hyperledger/src/github.com/gin-gonic/gin/gin.go:363 (0x93a9b5)
(*Engine).handleHTTPRequest: c.Next()
/mnt/e/codes/GitHub/Hyperledger/src/github.com/gin-gonic/gin/gin.go:328 (0x93a202)
(*Engine).ServeHTTP: engine.handleHTTPRequest(c)
/usr/lib/go-1.10/src/net/http/server.go:2694 (0x679d0b)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/lib/go-1.10/src/net/http/server.go:1830 (0x675e60)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/lib/go-1.10/src/runtime/asm_amd64.s:2361 (0x4573c0)
goexit: BYTE $0x90 // NOP
这是什么原因呢?
好像 cli, err := channel.New(ctx) 一直new不出来。