当我用Goland 1.0 EAP IDE调试fabric源代码orderer模块时,它可以调试并提示如下:
GOROOT=/usr/local/Cellar/go/1.8.3/libexec #gosetup
GOPATH=/Users/friends/Documents/VirtualMachine/share/gopath #gosetup
/usr/local/Cellar/go/1.8.3/libexec/bin/go build -i -o /private/var/folders/cg/mwzlhrjs5y55ny553g6xz9tr0000gn/T/___orderer_start -gcflags "-N -l" /Users/friends/Documents/VirtualMachine/share/gopath/src/github.com/hyperledger/fabric/orderer/main.go #gosetup
# command-line-arguments
orderer/main.go:76: undefined: NewServer
orderer/main.go:207: undefined: createLedgerFactory
调试配置如下:
事实上,NewServer存在于server.go中。
当我删除server.go和util.go,并将代码移到main.go.It工作时。我认为这可能是GoLand 1.0的EAP错误。
发布于 2017-11-09 07:41:05
在运行配置屏幕截图中,Run种类值是File。这意味着GoLand将只运行该文件。将其更改为package,并更改包名选项,该选项现在将显示为指向正确的包,在这种情况下,github.com/hyperledger/fabric/orderer
https://stackoverflow.com/questions/47193249
复制相似问题