go tool: no such tool “compile”


I got go tool: no such tool "compile" error after installing a local build of go.

The golang source was in /usr/local

$ cd /usr/local$ ls  
total 41240
drwxr-xr-x@ 19 root wheel 608B Oct 18 19:35 go
drwxr-xr-x 16 root wheel 512B Oct 18 19:35 .
-rw-r--r--@ 1 root wheel 20M Oct 18 19:35 go1.11.13.src.tar.gz

Next was go installation as follows:

cd src; ./all.bash

The final build output was

Installed Go for darwin/amd64 in /usr/local/go
Installed commands in /usr/local/go/bin

Now the PATH & GOROOT must have the following values:

$ export GOROOT=/usr/local/go
$export PATH=/usr/local/go/bin:$PATH

The correct GOPATH value fixed the problem.


  • Setting GOTOOLDIR
  • Reinstalling GO




Simplify Complexity

Golang, Distributed Systems, File Systems, Python, C/C++, Linux