go tool: no such tool "compile"

Issue

I recently started trying go to program some web based applications. At first, everything went fine, until I wanted to cross compile a binary for a different platform. I’m running MacOS and I wanted to compile a binary for linux, so I changed GOOS to linux and GOARCH to amd64. Since then, I always get the error message

go tool: no such tool "compile"

I’m using GoClipse, but running the compile manually by

go install hello.go

I get the same error. When changing back to compiling for darwin architecture, I get the same error now, so basically I’m totally unable to compile any code written in Go at the moment.

Solution

I installed it via the binary packages provided by google. In the end I actually got it back to work by just reinstalling it. Sometimes I’m just blind to the easy solution.

After that, I succeeded in cross compiling for linux machine after compiling the necessary cross-compilers by running env GOOS=linux GOARCH=arm GOROOT_BOOTSTRAP=/usr/local/go ./make.bash --no-clean from the Go sources directory.

Thanks for all you efforts, sorry to have kept you busy on such a simple matter.

Answered By – Benjamin Scharbau

Answer Checked By – Pedro (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.