Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why goland 1.0 EAP tips "#command-line-arguments undefined: NewServer"

When I debug the fabric source code orderer module with Goland 1.0 EAP IDE, it could debug and tips that:

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

the debug configurations is as following: enter image description here

in the fact ,NewServer exists in the server.go enter image description here

When I delete server.go and util.go, and move the code to main.go.It works. I think it may be GoLand 1.0 EAP BUG.

like image 929
Jim Green Avatar asked Dec 05 '25 07:12

Jim Green


1 Answers

In the Run Configuration screenshot, the Run Kind value is a File. That means GoLand will run that file only. Change it to Package and it change the package name option, which will now appear to point to the right package, in that case, github.com/hyperledger/fabric/orderer

like image 173
dlsniper Avatar answered Dec 07 '25 21:12

dlsniper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!