go tool: no such tool “compile”

I started facing 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 following:

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 te problem.

What didn’t work

  • Setting GOTOOLDIR
  • Reinstalling GO


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: