As stated in the title, I have a problem running the Golang code on Eclipse. I'm currently using Mac, and I installed go by using homebrew.
Currently, the folder where go is installed is as follows.
/usr/local/Cellar/go/1.5.2/..
and after running Terminal and typing open ~/.bash_profile
I added the following.
export GOROOT="/usr/local/Cellar/go/1.5.2/"
export PATH=$PATH:$GOROOT/bin
Am I still missing something else?
PS If I run the code using Terminal like go run main.go
, I have absolutely no problem. The problem must be due to some misconfiguration in Eclipse.
I had the same error. Putting the source file under a sub-folder in src fixed it.
Go to 'Run Configurations' -> Filter with Go Application -> select your project and then click the Environment tab, then click on select button and tick the GOPATH environment. select apply and then Run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With