I recently installed lubuntu 11.04 on my pc. Following this guide on installing go from source, installing golang on my pc went well. To test my installation, I ran hello.go and got this error:
fork/exec /tmp/go-build748212890/command-line-arguments/_obj/a.out: exec format error
I looked it up on google, and one of the more relevant results that I found said to remove the package, then reinstall again. That did not help.
Can you tell me what is causing this error, and how I can fix this?
Thanks, and have a nice day!
I had this problem - it was very simple: I had set $GOOS to something other than the OS I was testing on. You can't do cross-platform testing. So for "go test", don't set $GOOS. I'm pretty sure the "Exec format error" you got was a result of go test trying to execute something on the wrong architecture/OS.
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